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
main.cpp@1:48b43e5844cd, 2018-11-20 (annotated)
- Committer:
- WAT34
- Date:
- Tue Nov 20 10:02:53 2018 +0000
- Revision:
- 1:48b43e5844cd
- Parent:
- 0:18ab097e5fd9
modified for ikarashi test
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tknara | 0:18ab097e5fd9 | 1 | #include "mbed.h" |
| tknara | 0:18ab097e5fd9 | 2 | |
| tknara | 0:18ab097e5fd9 | 3 | Ticker ticker; |
| tknara | 0:18ab097e5fd9 | 4 | DigitalOut led1(LED1); |
| tknara | 0:18ab097e5fd9 | 5 | CAN can1(PA_11,PA_12); |
| WAT34 | 1:48b43e5844cd | 6 | char counter[3] = {1<<4, 240,(1<<4)^(240)}; |
| tknara | 0:18ab097e5fd9 | 7 | |
| tknara | 0:18ab097e5fd9 | 8 | void send() { |
| tknara | 0:18ab097e5fd9 | 9 | printf("send()\n"); |
| WAT34 | 1:48b43e5844cd | 10 | if(can1.write(CANMessage(1337, counter, 3))) { |
| tknara | 0:18ab097e5fd9 | 11 | printf("wloop()\n"); |
| WAT34 | 1:48b43e5844cd | 12 | printf("Message sent"); |
| WAT34 | 1:48b43e5844cd | 13 | } |
| tknara | 0:18ab097e5fd9 | 14 | led1 = !led1; |
| tknara | 0:18ab097e5fd9 | 15 | } |
| tknara | 0:18ab097e5fd9 | 16 | int main() { |
| tknara | 0:18ab097e5fd9 | 17 | printf("main()\n"); |
| WAT34 | 1:48b43e5844cd | 18 | ticker.attach(&send, 0.1); |
| tknara | 0:18ab097e5fd9 | 19 | CANMessage msg; |
| tknara | 0:18ab097e5fd9 | 20 | while(1) { |
| tknara | 0:18ab097e5fd9 | 21 | printf("loop()\n"); |
| tknara | 0:18ab097e5fd9 | 22 | wait(0.2); |
| tknara | 0:18ab097e5fd9 | 23 | } |
| WAT34 | 1:48b43e5844cd | 24 | } |