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 10:5b67d18f30a9, committed 2014-09-04
- Comitter:
- Hatter
- Date:
- Thu Sep 04 02:53:40 2014 +0000
- Parent:
- 9:f05f881226a3
- Child:
- 11:8b1a63a1172a
- Commit message:
- bug fixed
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 04 02:39:04 2014 +0000
+++ b/main.cpp Thu Sep 04 02:53:40 2014 +0000
@@ -26,7 +26,7 @@
MultiSerial xbee(p13,p14,read);
-//MultiSerial armMbed(p9,p10,write);
+MultiSerial armMbed(p9,p10,write);
typedef struct{
@@ -37,13 +37,13 @@
xbee_packet packet;
-uint8_t get_data[DATA_NUM];
+uint8_t get_data[DATA_NUM]={0};
int main()
{
//sw.mode(PullUp);
- // xbee_packet *pt_packet=&packet;
+ xbee_packet *pt_packet=&packet;
xbee.read_data(get_data,XBEE_KEY);
@@ -58,8 +58,8 @@
//memcpy(&packet, get_data, DATA_NUM); //ちょい危険
- packet.arm[0] = get_data[0];
- packet.leg = get_data[1];
+ packet.arm[0] = get_data[1];
+ packet.leg = get_data[0];
check = get_data[1];
@@ -69,9 +69,9 @@
if(packet.leg&0x4) motors = 0x50; //p25,p27
if(packet.leg&0x8) motors = 0xA0; //p26,p28
- pc.printf(" arm = %d" ,packet.arm[1]);
+ pc.printf(" arm = %d" ,packet.arm[0]);
pc.printf(" leg = %d" ,packet.leg);
- // armMbed.write_data(pt_packet->arm,ARM_KEY);
+ armMbed.write_data(pt_packet->arm,ARM_KEY);
}
}
\ No newline at end of file