6 #ifndef EBOARD_HEADER_GUARD 7 #define EBOARD_HEADER_GUARD 8 #pragma GCC diagnostic push 9 #pragma GCC diagnostic ignored "-Wall" 10 #pragma GCC diagnostic ignored "-Wextra" 15 #define EBOARD_VERSION "3.1.17m" 16 #define EBOARD_VERSION_NBR 327 18 #define VALUE_TO_STRING(x) #x 22 #define PREPROCESS_DEBUG 1 25 #define VALUE(x) VALUE_TO_STRING(x) 27 #ifndef PREPROCESS_DEBUG 29 #define PREPROCESS_DEBUG 0 31 #define PPERFORM_PRAGMA(str) _Pragma(#str) 34 #if PREPROCESS_DEBUG == 1 35 #pragma message("You are using eBoard-header " VALUE(EBOARD_VERSION) "{" VALUE(EBOARD_VERSION_NBR) "} written by EagleoutIce") 36 #define DEBUG_MSG(str) PPERFORM_PRAGMA(message ("" #str)) 37 #define MACRO_MSG(mac,str) PPERFORM_PRAGMA(message("You set " #mac " to " VALUE(mac) ": " #str)) 39 #define DEBUG_MSG(str) ; 40 #define MACRO_MSG(mac,str) ; 44 DEBUG_MSG(
"If you do not want any preprocessing information from this eBoard-Header set PREPROCESS_DEBUG to 0");
48 DEBUG_MSG(
"Documentation macro SET => Full doc features enabled");
53 #define EBOARD_I2C 0x1 58 #define EBOARD_LCD 0x1 62 #define EBOARD_SHIFT_REGISTER 0x1 66 #define EBOARD_BLUETOOTH 0x1 74 #define __AVR_ATmega2560__ 78 #define __AVR_ATmega328P__ 82 #define EBOARD_NEO 0x1 94 #if defined(ARDUINO) //general platform-check [No tab] 95 #include <avr/pgmspace.h> 102 #ifndef EBOARD_GUESSPATH 103 DEBUG_MSG(
"You are using Guesspath! Necessary libraries for eBoard will be included automatically");
107 #define EBOARD_GUESSPATH 0x1 109 DEBUG_MSG(
"You are not using Guesspath! Necessary libraries for eBoard have to be included manually");
114 #define main eVirtual_main //main has a different meaning^^ 116 #if ARDUINO >= 100 //this could be only Arduino.h but this snippet is portable :D 122 #if not ( defined(__AVR_ATmega2560__) || defined(__AVR_ATmega328P__)) 123 #error "This library was build for ARDUINO UNO R3 Aand ARDUINO MEGA 2560!" 128 #if defined(__AVR_ATmega2560__) 129 DEBUG_MSG(
"Building for Arduino Mega with ATmega2560");
133 #define PIN_MAX 0x32 //53 pins to address - 4 !!53 is SS 135 DEBUG_MSG(
"Building for Arduino Uno or Nano with ATmega328P");
136 #define PIN_MAX 0xA // 13 Pins to address - 4 !!10 is SS 140 #include <avr/interrupt.h> 142 #if EBOARD_I2C > 0x0 && EBOARD_GUESSPATH > 0x0 143 DEBUG_MSG(
"You enabled I²C features");
146 #ifndef TwoWire_h //because it will be included ._. 157 DEBUG_MSG(
"You disabled I²C");
162 #ifndef EBOARD_USE_SPI 163 #define EBOARD_USE_SPI 0x1 166 #if EBOARD_USE_SPI > 0x0 167 DEBUG_MSG(
"You enabled SPI");
168 #ifndef _SPI_H_INCLUDED 169 #define _SPI_H_INCLUDED 174 DEBUG_MSG(
"You disabled SPI");
177 #if (EBOARD_I2C > 0x0) && (EBOARD_LCD > 0x0) 178 #include <avr/pgmspace.h> 179 DEBUG_MSG(
"You enabled LCD");
192 DEBUG_MSG(
"You defined IGNORE_SIZE: byte will be used");
195 DEBUG_MSG(
"You did not define IGNORE_SIZE: int will be used");
202 #ifndef EBOARD_DEBUG_MODE 203 #define EBOARD_DEBUG_MODE 0x1 206 #if EBOARD_DEBUG_MODE > 0x0 215 #define EBOARD_NANO 0x0 218 #if EBOARD_NANO > 0x0 || defined(DOC) 219 #ifndef EBOARD_NANO_STEER 223 #define EBOARD_NANO_STEER 12 225 #ifndef EBOARD_NANO_MAIN 229 #define EBOARD_NANO_MAIN 13 231 MACRO_MSG(
EBOARD_NANO,
"Using Arduino NANO environment [e.g. remove SoccerBoard]");
232 #if PREPROCESS_DEBUG > 0x1 233 #pragma message("Using " VALUE(EBOARD_NANO_STEER) " as data pin for STEERING MOTOR") 234 #pragma message("Using " VALUE(EBOARD_NANO_MAIN) " as data pin for MAIN (Driving) MOTOR") 237 MACRO_MSG(
EBOARD_NANO,
"Using Arduino UNO/MEGA environment");
243 #ifndef EBOARD_CHECK_PINS 244 #define EBOARD_CHECK_PINS 0x1 247 #if EBOARD_CHECK_PINS > 0x0 253 #ifndef EBOARD_SHIFT_REGISTER 257 #define EBOARD_SHIFT_REGISTER 0x0 260 #if EBOARD_SHIFT_REGISTER > 0x0 269 #ifndef EBOARD_CHECK_PINS_PWM 270 #define EBOARD_CHECK_PINS_PWM 0x1 273 #if EBOARD_CHECK_PINS_PWM > 0x0 282 #ifndef EBOARD_DEBUG_SPEED 283 #define EBOARD_DEBUG_SPEED 9600 285 #if PREPROCESS_DEBUG > 0x0 286 #pragma message("Set Debugging speed to " VALUE(EBOARD_DEBUG_SPEED)) 293 #ifndef EBOARD_SPI_SERVO_MAX 294 #define EBOARD_SPI_SERVO_MAX 2 296 #if PREPROCESS_DEBUG > 0x0 297 #pragma message("Set amount of used Servos to " VALUE(EBOARD_SPI_SERVO_MAX)) 302 #ifndef EBOARD_USE_UTILITY 303 #define EBOARD_USE_UTILITY 0x1 305 #if EBOARD_USE_UTILITY > 0x0 314 #define EBOARD_COPY_AND_PASTE 0x1 318 #ifndef EBOARD_PWM_SPE 319 #define EBOARD_PWM_SPE 1 321 #if PREPROCESS_DEBUG > 0x0 322 #pragma message("Set PWM interval to " VALUE(EBOARD_PWM_SPE) "s") 329 #define EBOARD_I2C 0x0 //disabled by default 332 #ifndef EBOARD_BLUETOOTH 336 #define EBOARD_BLUETOOTH 0x0 339 #if EBOARD_BLUETOOTH > 0x0 349 #define EBOARD_CLAMP 0x1 351 #if EBOARD_CLAMP > 0x0 352 MACRO_MSG(
EBOARD_CLAMP,
"Motor Range is set to [0;1023]");
354 MACRO_MSG(
EBOARD_CLAMP,
"Motor Range is set to [-300;300]");
361 #define EBOARD_NEO 0x0 364 MACRO_MSG(
EBOARD_NEO,
"Adafruit Neo-Pixel support enabled");
366 MACRO_MSG(
EBOARD_NEO,
"Adafruit Neo-Pixel support disabled");
372 #ifndef EBOARD_USE_RESET 373 #define EBOARD_USE_RESET 0x1 376 #if EBOARD_USE_RESET > 0x0 386 #ifndef PIN_BLUETOOTH_STATE 387 #if defined(__AVR_ATmega2560__) 388 #define PIN_BLUETOOTH_STATE 0x13 // 19 390 #define PIN_BLUETOOTH_STATE 0x2 397 #ifndef PIN_BLUETOOTH_RX 398 #if defined(__AVR_ATmega2560__) 399 #define PIN_BLUETOOTH_RX 0x13 // 19 401 #define PIN_BLUETOOTH_RX 0x2 408 #ifndef PIN_BLUETOOTH_TX 409 #if defined(__AVR_ATmega2560__) 410 #define PIN_BLUETOOTH_TX 0x12 // 18 412 #define PIN_BLUETOOTH_TX 0x3 419 #ifndef PIN_MOTOR_DIR 420 #define PIN_MOTOR_DIR 0x4 426 #ifndef PIN_MOTOR_SPE 427 #define PIN_MOTOR_SPE 0x5 433 #ifndef PIN_SHIFT_CLK 434 #define PIN_SHIFT_CLK 0x6 439 #ifndef PIN_SHIFT_DAT 440 #define PIN_SHIFT_DAT 0x7 445 #ifndef PIN_SHIFT_LAT 446 #define PIN_SHIFT_LAT 0x8 459 #if (EBOARD_BLUETOOTH > 0x0) && defined(__AVR_ATmega328P__) 460 #if EBOARD_GUESSPATH > 0x0 461 #ifndef SoftwareSerial_h 463 #define SoftwareSerial_h 475 #if EBOARD_DEBUG_MODE > 0x0 479 #define __ASSERT_USE_STDERR 483 #if EBOARD_BLUETOOTH > 0x0 487 #if EBOARD_SHIFT_REGISTER > 0x0 494 extern void rept_task(
void);
495 DEBUG_MSG(
"You defined REPT_TASK: you have to define rept_task(void)!");
497 DEBUG_MSG(
"You did not define REPT_TASK: rept_task(void) will not have any effect");
500 #if EBOARD_USE_SPI > 0x0 && (EBOARD_NANO == 0x0) 507 #if EBOARD_COPY_AND_PASTE > 0x0 && EBOARD_NANO == 0 515 #if EBOARD_BLUETOOTH > 0x0 529 #if EBOARD_NANO > 0x0 || defined(DOC) 531 #if EBOARD_GUESSPATH > 0x0 536 #if EBOARD_COPY_AND_PASTE > 0x0 547 #if EBOARD_NANO > 0x0 || defined(DOC) 552 #error This library is build for arduino-devices and should be used only in the Arduino IDE or with a similar linking process 554 #pragma GCC diagnostic pop
this namespace contains all the Don't use manually classes ;)
[SPI] This is used to communicate with the smart servo shield         Don't use manually ...
This is used to avoid path resolving issues and defines the common known Arduino SoftwareSerial inter...