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:
- 4:4051a72a22f7
- Parent:
- 3:35151308f847
- Parent:
- 2:654aafc318bf
- Child:
- 6:2c713a0187dd
diff -r 35151308f847 -r 4051a72a22f7 main.cpp --- a/main.cpp Tue May 23 07:57:18 2017 +0000 +++ b/main.cpp Tue May 23 08:01:06 2017 +0000 @@ -16,6 +16,10 @@ CANMessage MessageRx; CANMessage MessageTx; +CANMessage MessageBuzzer; + +bool Send_Buzz=false; // Envoyer tramme au buzzer + unsigned int Id; void canReader(void) @@ -82,30 +86,29 @@ void thB() { - while (true) + while(true) { led1 = !led1; printf("TIC3s\n\r"); - MessageTx.id=Id; - CanPort.write(MessageTx); - - if (Id < 0x3FF) Id++; - else Id = 0x000; + MessageBuzzer.id=Id; + CanPort.write(MessageBuzzer); + /*if (Id < 0x3FF) Id++; + else Id = 0x000;*/ wait(3); } } - - int main() { + + CanPort.frequency(20000); - Id = 0x1A5; - MessageTx.len=2; - MessageTx.data[0] = 0x55; - MessageTx.data[1] = 0xAA; + Id = 0x222; + MessageBuzzer.len=1; + MessageBuzzer.data[0] = 0x01; + //MessageTx.data[1] = 0xAA; MessageTx.format = CANStandard; //MessageTx.format = CANExtended; @@ -122,11 +125,9 @@ led1 = 0; led2 =0 ; printf("Start OK\n\r"); - LocalFileSystem local("local"); - FILE *fp = fopen("/local/out.txt", "w"); // Open "out.txt" on the local file system for writing - fprintf(fp, "Hello World!"); - fclose(fp); + + while (true) {