![]() |
eBoard ๐
โ โงโจ
Written for SIA 2017/2018
|
If you have any problems or questions I recommend reading [ ๐ผ ] GENERAL INTRODUCTION first.
Please note that, This code comes with absolutely no warranty!
You should note the following things:
What you should care about:
This Header file was created to port Codes running on the qfix SoccerBoard [DynamixelBoard etc...] directly onto the Arduino UNO R3 [with Smart Servo Shield].
To use it you'll have to replace all qfix-related header-files [*.h] with the following:
It is possible to add this header as library aswell: Tutorials
The following sections will introduce you further ;)
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_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_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_NANO_MAIN | [NANO] pin(13) | data-Pin for the main Motor used for driving |
EBOARD_NANO_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 :/
On small projects I prefer the single-file header!
Your able to 'manage the includings' via the preprocessor constants
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.