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 master_1 by
Revision 2:39b25e32f00a, committed 2014-12-08
- Comitter:
- raizel_varun
- Date:
- Mon Dec 08 03:56:44 2014 +0000
- Parent:
- 1:5ed5d1e46e92
- Commit message:
- sdfc
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Dec 07 07:39:35 2014 +0000 +++ b/main.cpp Mon Dec 08 03:56:44 2014 +0000 @@ -10,23 +10,30 @@ int main() { + char* command= new char; + char array[10]; + strcpy(array,"green"); + while(1) - { - char* command= new char; + { bool write_loop = true; + printf("\ncommand from com \n\r"); m2s_interrupt=0; *command=pc.getc(); //characters 0 to 4 are assumed to be commands printf("\n command detected\n\r"); m2s_interrupt =1; bool master_status_write = true; - master.frequency(100000); - while(master_status_write) - { - master.start(); - master_status_write = (bool) master.write(addr|0x00,command,1); - printf("\n master trying to write \n\r"); - } + master.frequency(100000); + + while(write_loop ){ + printf("2 master clk freq setup and addressing slave\n\r"); + master.start(); //initiating the data transfer + master_status_write = (bool) master.write(addr|0x00,command,6); + if(master_status_write==0){ + printf("3 master has written %c to slave\n\r",*command); + write_loop=false; + } printf("command %c sent to slave\n\r",*command); - delete command; + //delete command; } -} \ No newline at end of file +}} \ No newline at end of file