![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
sadasd
main.cpp
- Committer:
- Tafkal
- Date:
- 2019-06-11
- Revision:
- 2:68fc7aa5f068
- Parent:
- 1:285c99e43ed3
File content as of revision 2:68fc7aa5f068:
#include "mbed.h" CAN can1(PA_11, PA_12, 100000); Serial pc(PC_10,PC_11,19200); Ticker ticker; CANMessage msg; char counter = 0; void send() { printf("send()\n"); if(can1.write(CANMessage(1601, &counter, 1))) { pc.printf("wloop()\n"); counter++; pc.printf("Message sent: %d\n", counter); } } int main() { wait(1); pc.printf("main()\n"); ticker.attach(&send, 1); while(1){ if(can1.read(msg)) { pc.printf("Mmmmmm, jarac kazes?"); pc.printf(" Id: %d\n",msg.data[0]); } //pc.printf("KrvavuTiMajkuJebem!\n"); } }