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 slave_1 by
Diff: main.cpp
- Revision:
- 2:ba6aa46cd931
- Parent:
- 1:afb4a0df7ff1
--- a/main.cpp Sun Dec 07 07:38:30 2014 +0000
+++ b/main.cpp Mon Dec 08 03:57:31 2014 +0000
@@ -15,14 +15,25 @@
char *command = new char;
slave.address(0x20);
int slave_status =1;
- slave.stop();
- while(slave.receive()!=3);
- while(slave_status)
+ //slave.stop();
+ //while(slave.receive()!=3);
+
+ while(slave_status)
+ {
+
+
slave_status=slave.read(command,1);
- printf("\nread %c from master\n\r",*command);
- execute_command(command); //assumed command is very important
+
+ }
+
+
+ printf("\nread %c from master\n\r",command);
+ execute_command(command);
+ //assumed command is very important
printf("\n done \n \r");
delete command;
+
+
}
void execute_command(char* cmd)
@@ -50,6 +61,6 @@
m2s_interrupt.rise(&read_command);
while(1)
{
- ;
+
}
}
\ No newline at end of file
