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:
- 2:654aafc318bf
- Parent:
- 1:6f8bf5bdc70f
- Child:
- 4:4051a72a22f7
- Child:
- 5:e7fa92a21eff
--- a/main.cpp Wed May 17 10:12:31 2017 +0000 +++ b/main.cpp Tue May 23 07:20:59 2017 +0000 @@ -15,6 +15,10 @@ CANMessage MessageRx; CANMessage MessageTx; +CANMessage MessageBuzzer; + +bool Send_Buzz=false; // Envoyer tramme au buzzer + unsigned int Id; @@ -44,30 +48,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; @@ -81,12 +84,7 @@ threadB.start(thB); led1 = 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) {