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
Revision 1:48b43e5844cd, committed 2018-11-20
- Comitter:
- WAT34
- Date:
- Tue Nov 20 10:02:53 2018 +0000
- Parent:
- 0:18ab097e5fd9
- Commit message:
- modified for ikarashi test
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 12 13:21:47 2018 +0000
+++ b/main.cpp Tue Nov 20 10:02:53 2018 +0000
@@ -3,23 +3,22 @@
Ticker ticker;
DigitalOut led1(LED1);
CAN can1(PA_11,PA_12);
-char counter = 0;
+char counter[3] = {1<<4, 240,(1<<4)^(240)};
void send() {
printf("send()\n");
- if(can1.write(CANMessage(1337, &counter, 1))) {
+ if(can1.write(CANMessage(1337, counter, 3))) {
printf("wloop()\n");
- counter++;
- printf("Message sent: %d\n", counter);
- }
+ printf("Message sent");
+ }
led1 = !led1;
}
int main() {
printf("main()\n");
- ticker.attach(&send, 0.5);
+ ticker.attach(&send, 0.1);
CANMessage msg;
while(1) {
printf("loop()\n");
wait(0.2);
}
-}
\ No newline at end of file
+}