Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of XBEE by
SwitchCase.h
- Committer:
- RobinIsLeg
- Date:
- 2016-10-18
- Revision:
- 1:ce4058bc0913
- Parent:
- 0:8cdf90642ef6
- Child:
- 2:983d482357b9
File content as of revision 1:ce4058bc0913:
// Add commands you wish to implement to the switch statement and #define the command with the next unused letter of the alphabet
// Please try to minimise the number of lines you add per command i.e. for adding a steer left command simply call steerLeft() which
// you then define in a separate file. This will make it easier to keep track of the big picture of what other people are making
// the car do. Also you should only need to edit this file and not the other two in this library.
// To use the wireless comms simply #include "XBEE.h"
// Create a serial object for the microcontroller being used. for the k64f(M4 board) do: Serial ArbitraryName(PTC17, PTC16);
// Create an instance of XBEE passing by reference the serial object: XBEE xbee(&ArbitraryName);
// In the infinite loop for the car add: xbee.checkForCommand(); This function passes any commands received through the switch case below.
// This is all you need to get started. Additional functions you may wish to use can be found in the public section of the class in XBEE.h
#define START 'A'
#define STOP 'B'
#define STATUSSTRING 'C'
void XBEE::switchCase(char command)
{
switch(command){
case START:
break;
case STOP:
break;
case STATUSSTRING:
test();
sendCommand("But how long is a string?\n");
break;
default:
sendCommand("Invalid Command Received\n");
break;
}
}
