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 mbed-STM32F103C8T6
main.cpp@0:4ef048c63bdc, 2018-07-22 (annotated)
- Committer:
- RuslanUrya
- Date:
- Sun Jul 22 15:37:35 2018 +0000
- Revision:
- 0:4ef048c63bdc
- Child:
- 1:fc19811d6c3e
??? 1. ???????? ?????????? ?????? 0.5 ???;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RuslanUrya | 0:4ef048c63bdc | 1 | #include "mbed.h" |
| RuslanUrya | 0:4ef048c63bdc | 2 | #include "stm32f103c8t6.h" |
| RuslanUrya | 0:4ef048c63bdc | 3 | #define id 3 |
| RuslanUrya | 0:4ef048c63bdc | 4 | |
| RuslanUrya | 0:4ef048c63bdc | 5 | CAN can (PA_11, PA_12); |
| RuslanUrya | 0:4ef048c63bdc | 6 | Ticker ticker; |
| RuslanUrya | 0:4ef048c63bdc | 7 | |
| RuslanUrya | 0:4ef048c63bdc | 8 | char i = 1; |
| RuslanUrya | 0:4ef048c63bdc | 9 | void transmit(){ |
| RuslanUrya | 0:4ef048c63bdc | 10 | if (i++ > 100) i = 0; |
| RuslanUrya | 0:4ef048c63bdc | 11 | can.write(CANMessage(id, &i, 1, CANData, CANStandard)); |
| RuslanUrya | 0:4ef048c63bdc | 12 | } |
| RuslanUrya | 0:4ef048c63bdc | 13 | |
| RuslanUrya | 0:4ef048c63bdc | 14 | int main() { |
| RuslanUrya | 0:4ef048c63bdc | 15 | confSysClock(); |
| RuslanUrya | 0:4ef048c63bdc | 16 | |
| RuslanUrya | 0:4ef048c63bdc | 17 | ticker.attach(&transmit, 0.5); |
| RuslanUrya | 0:4ef048c63bdc | 18 | while(1) { |
| RuslanUrya | 0:4ef048c63bdc | 19 | |
| RuslanUrya | 0:4ef048c63bdc | 20 | } |
| RuslanUrya | 0:4ef048c63bdc | 21 | } |