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.
Dependencies: mbed MultiSerial
Revision 38:098150180639, committed 2014-10-14
- Comitter:
- bousiya03
- Date:
- Tue Oct 14 12:24:42 2014 +0000
- Parent:
- 37:53f8b2c0bad6
- Child:
- 39:18b1bc93a5f7
- Commit message:
Changed in this revision
| MultiSerial.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MultiSerial.lib Tue Oct 14 10:52:20 2014 +0000 +++ b/MultiSerial.lib Tue Oct 14 12:24:42 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/B/code/MultiSerial/#9e14b87bfdac +http://mbed.org/teams/B/code/MultiSerial/#0ca02e8c37e5
--- a/main.cpp Tue Oct 14 10:52:20 2014 +0000
+++ b/main.cpp Tue Oct 14 12:24:42 2014 +0000
@@ -15,7 +15,7 @@
#include "mbed.h"
#include "MultiSerial.h"
-#define DATA_NUM 2 //DATA_NUM[byte]通信 この値はmemcpy使ってるんでxbee_packet構造体のメモリ数といい感じに合わせるようにしてください
+#define DATA_NUM 2 //DATA_NUM[byte]通信
#define XBEE_KEY 0xAA //keycode
#define ARM_KEY 0xAA
@@ -34,17 +34,20 @@
#define TIME 0
-BusOut check(LED1,LED2,LED3,LED4);
-BusOut motors(p13,p14,p15,p16,p17,p18,p19,p20);
+BusOut check(LED1,LED2,LED3,LED4);
+BusOut motors(p13,p14,p15,p16,p17,p18,p19,p20);
-PwmOut pwm[4]= {p21,p22,p23,p24};
+PwmOut pwm[4]= {p21,p22,p23,p24};
-Serial pc(USBTX,USBRX);
+Serial pc(USBTX,USBRX);
MultiSerial xbee(p28,p27);
MultiSerial armMbed(p9,p10);
-Ticker xbee_check;
+Ticker xbee_check;
+
+uint8_t get_data[DATA_NUM] = {0};
+uint8_t check_data[2] = {0};
/* data structure */
typedef struct {
@@ -56,9 +59,6 @@
xbee_packet packet = {0};
-uint8_t get_data[DATA_NUM]= {0};
-uint8_t check_data[2]= {0};
-
void safety_mode(){
get_data[0] = 0;
@@ -84,11 +84,12 @@
break;
case 1:
- //
+
check = 0xF;
wait(0.5);
check = 0;
wait(0.5);
+
break;
}
}
@@ -109,7 +110,6 @@
xbee_packet *pt_packet=&packet;
/* Serial connection init */
-
xbee.start_read();
xbee.read_data(get_data,XBEE_KEY);
@@ -122,8 +122,6 @@
for(;;) {
-
-
packet.arm[0] = get_data[1];
packet.leg = get_data[0];