Unfinished version 0.6 library for the Pi Swarm robot. NOTE: This library is not yet finished or fully tested - it will change.
Dependents: Pi_Swarm_Blank Aggregation-Flocking_2 Pi_Swarm_User_Command_RF_Test
Fork of Pi_Swarm_Library by
Diff: piswarm.h
- Revision:
- 5:09d535cb9e9d
- Parent:
- 4:52b3e4c5a425
- Child:
- 6:69a48b1ec3af
--- a/piswarm.h Sun Feb 02 22:30:47 2014 +0000 +++ b/piswarm.h Sun Feb 02 22:43:22 2014 +0000 @@ -22,6 +22,42 @@ #include "rpc.h" #endif +// The following defines are user parameters and may be edited +// SWARM_SIZE - size of swarm (+1). Max 32. +// USE_COMMUNICATION_STACK - 1 to enable, 0 to bypass +// CALIBRATE_COLOURS - 1 to increase blue intensity, 0 to not +// CENTER_LED_BRIGHTNESS - Range 0 to 100 +// OUTER_LED_BRIGHTNESS - Range 0 to 100 +// PC_BAUD - PC Serial Baudrate. Max 115200 +// RF_ALLOW_COMMANDS - 1 to allow remote RF commands, 0 to block +// RF_USE_LEDS - 1 to use MBED LEDs to display RF status +// RF_USE_TDMA - 1 to use time-delayed responses to broadcast messages +// RF_TDMA_TIME_PERIOD_US 15625 - Period of delay to use (per ID) in us. +// PISWARM_DEBUG - 1 to send general Pi Swarm debug information over USB serial interface +// RF_DEBUG - 1 to send communication stack debug information over USB serial interface +// RF_VERBOSE - 1 to send verbose RF debug information over USB serial interface +// START_RADIO_ON_BOOT - 1 to enable RF transceiver and comms stack on boot +// RF_FREQUENCY - Frequency of RF chip. See datasheet for details (default 435000000) +// RF_DATARATE - Baud rate of the RF chip. Max 115200, default 57600. + +#define SWARM_SIZE 32 +#define USE_COMMUNICATION_STACK 1 +#define CALIBRATE_COLOURS 1 +#define CENTER_LED_BRIGHTNESS 30 +#define OUTER_LED_BRIGHTNESS 50 +#define PC_BAUD 115200 +#define RF_ALLOW_COMMANDS 1 +#define RF_USE_LEDS 1 +#define RF_USE_TDMA 1 +#define RF_TDMA_TIME_PERIOD_US 15625 +#define PISWARM_DEBUG 1 +#define RF_DEBUG 1 +#define RF_VERBOSE 1 +#define START_RADIO_ON_BOOT 1 +#define RF_FREQUENCY 435000000 +#define RF_DATARATE 57600 + +// The remaining defines give the addresses of hardware and 3-Pi instructions etc. and should not be changed #define SEND_SIGNATURE 0x81 #define SEND_RAW_SENSOR_VALUES 0x86 #define SEND_TRIMPOT 0xB0