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
Fork of lib-nautiluscan by
CANFactory.cpp@2:f66b52e5a6a8, 2015-10-13 (annotated)
- Committer:
- xhkunlimit
- Date:
- Tue Oct 13 20:46:45 2015 +0000
- Revision:
- 2:f66b52e5a6a8
- Parent:
- 1:22f609fa3a18
createmotorcommand now static
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| xhkunlimit | 1:22f609fa3a18 | 1 | #include "CANFactory.h" |
| xhkunlimit | 1:22f609fa3a18 | 2 | CANFactory::CANFactory(){ |
| xhkunlimit | 1:22f609fa3a18 | 3 | } |
| xhkunlimit | 1:22f609fa3a18 | 4 | CANFactory::~CANFactory(){ |
| xhkunlimit | 1:22f609fa3a18 | 5 | } |
| xhkunlimit | 1:22f609fa3a18 | 6 | CANMessage CANFactory::CreateMotorCommand(int rpm, bool way, bool status){ |
| xhkunlimit | 1:22f609fa3a18 | 7 | CANMessage can; |
| xhkunlimit | 1:22f609fa3a18 | 8 | can.id = 0x101; |
| xhkunlimit | 1:22f609fa3a18 | 9 | can.data[0] = (uint8_t)(rpm/100); |
| xhkunlimit | 1:22f609fa3a18 | 10 | can.data[1] = (uint8_t)(rpm & 99); |
| xhkunlimit | 1:22f609fa3a18 | 11 | can.data[2] = way; |
| xhkunlimit | 1:22f609fa3a18 | 12 | can.data[3] = status; |
| xhkunlimit | 1:22f609fa3a18 | 13 | return can; |
| xhkunlimit | 1:22f609fa3a18 | 14 | } |
