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.
Diff: main.cpp
- Revision:
- 0:dd5518967e8a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Feb 20 11:47:19 2016 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+Serial xbee(p9,p10);
+DigitalIn up(p15); //pin 15 is connected to the joystick on the application board
+DigitalIn down(p12); //pin 12 is connected to the joystick on the application board
+DigitalOut LED(LED1); //test led to check if the joystick is working
+
+int main() {
+ xbee.baud(57600);
+ while(1) {
+ wait_ms(100); //to reduce buffer fill. Can be increased at the expense of less sensitive buttons
+ if(up){ //check the direction of the joystick
+ xbee.putc('u'); //send a character
+ LED = 1;
+ }
+ if(down){
+ xbee.putc('d');
+ }
+
+ }
+}