![]() |
eBoard
①⑧⑨
Written for SIA 2017/2018
|
YOU SHOULD READ [ ✍️ ] GENERAL INTRODUCTION THIS IS A WIP PAGE ;)
If you wan't to use the I2C extensions you should have this two lines the beginning of your code:
While in development you shouldn't disable any macro... If you change to release mode, write (as a minimum) the following before all includings:
There are multiple macros you can manipulate the behaviour of this header [full list is here: Macros and Constants]:
General
Identifier | Requirement | Meaning |
---|---|---|
[IGNORE_SIZE] | Define via 'define' | the size of this program will grow but the used variable-space will shrink... |
[EBOARD_HELPCAR] | Define via 'define' | This will change motor setup etc. to the Helpcar and enable set_motor_speed() etc... This will change the behaviour of the SoccerBoard::motor() shortcut |
EBOARD_DEBUG_MODE | [DEBUGMODE] {int } Default: 9600 | Sets the Serial debug speed for DEBUG |
EBOARD_CHECK_PINS | {bool} Default: 0x1 | 0x0: disables range-check for normal READ and WRITE. |
EBOARD_CHECK_PINS_PWM | {bool} Default: 0x1 | 0x0: disables range-check for PWM-WRITE |
EBOARD_USE_SPI | {bool} Default: 0x1 | 0x0: disables internal SPI-handling |
EBOARD_USE_UTILITY | {bool} Default: 0x1 | removes useless code-parts [will vary on used board] |
EBOARD_SPI_SERVO_MAX | {int } Default: 2 | Sets the amount of the visible, connected AX12Servo objects |
EBOARD_I2C | {bool} Default: 0x0 | 0x1: enables I2C tools |
EBOARD_I2C_HELPER | [I2C] {bool} Default: 0x0 | 0x1: enables I2C helper |
EBOARD_SHIFT_REGISTER | {bool} Default: 0x0 | 0x1: enables SHIFT_REGISTER |
EBOARD_BLUETOOTH | {bool} Default: 0x0 | 0x1: enables Bluetooth support |
EBOARD_PWM_SPE | {int } Default: 1 | Sets the duty cycle for Async task execution |
EBOARD_CLAMP | {bool} Default: 0x1 | 0x0: disables clamp |
EBOARD_USE_RESET | {bool} Default: 0x1 | 0x0: disable software reset |
EBOARD_LCD | [I2C] {bool} Default: 0x0 | 0x1: enable support for LCD display. Needs EBOARD_I2C set to 0x1 |
EBOARD_NEO | {bool} Default: 0x0 | 0x1: enable support for Adafruit-NeoPixel-Devices |
EBOARD_GUESSPATH | {bool} Default: 0x1 | 0x0: disable automatic path_guess this will increase the program size [manual includings necessary] |
PREPROCESS_DEBUG | {bool} Default: 0x0 | 0x1: enable preprocessing messages from eBoard |
Pins
Identifier | Default ID [UNO/NANO \ MEGA] | Addiotional Information |
---|---|---|
PIN_BLUETOOTH_RX | pinID(2\19) | RX-Pin – why? [Version 1.2e 🐦 - On your command, master [~100m]] |
PIN_BLUETOOTH_TX | pinID(3\18) | TX-Pin – why? [Version 1.2e 🐦 - On your command, master [~100m]] |
PIN_MOTOR_DIR | pinID(4) | MotorControl [DIR] |
PIN_MOTOR_SPE | pinID(5) | MotorControl [SPE] |
PIN_SHIFT_CLK | pinID(6) | shift-Clock |
PIN_SHIFT_DAT | pinID(7) | shift-Data |
PIN_SHIFT_LAT | pinID(8) | shift-Latch |
PIN_BLUETOOTH_STATE | pinID(2\19) (if==RX-Pin: unset) | if != RX-Pin: Pin of HC-05 connection-state |
EBOARD_HELPCAR_MAIN | [NANO] pin(13) | data-Pin for the main Motor used for driving |
EBOARD_HELPCAR_STEER | [NANO] pin(12) | data-Pin fot the steering Servo used for steering |
This is the smart-servo shield this code was written for its connected by SPI with the UNO R3. In case of an emergency it is possible to hardcode a connection interface to drive the AX-12A Servo directly from the arduino... but this is very expensive :/
The Arduino is a single core processor. That means it isn't possible to do multiple tasks at once.
To enable async task execution eBoard provides this mechanism (write this before including the eBoard header!).
The execution cycle is EBOARD_PWM_SPE seconds and the method will be invoked after the resend of the Motor-PWM value.
Take a look at this cool stability graph: