Gabor Feher
/
BMWE90-InstrumentCluster
Making a BMW E90 instrument cluster alive for demonstration purposes
Diff: main.cpp
- Revision:
- 3:4a4463380739
- Parent:
- 2:ef9a8a114395
--- a/main.cpp Fri Mar 10 09:03:10 2017 +0000 +++ b/main.cpp Sat Mar 11 10:03:52 2017 +0000 @@ -1,5 +1,6 @@ #include "mbed.h" #include "T15Msg.h" +#include "SpeedMsg.h" Timer timer100; Timer timer200; @@ -7,7 +8,9 @@ Serial pc(USBTX, USBRX); DigitalOut led1(PA_5); CAN can1(PB_8, PB_9); // rd, td Transmitter + T15Msg t15; +SpeedMsg speed; int fuel1 = 0x4F04; int fuel2 = 0x2312; @@ -157,6 +160,7 @@ if (timer100.read_ms() > 100) { sendT15(); + speed.sendMessage(&can1); timer100.reset(); led1 = !led1; @@ -216,10 +220,12 @@ if (strcmp(command, "START") == 0) { pc.printf("Start\r\n"); t15.start(); + speed.setSpeed(0x13, 0x4d, 0x46, 0x4d, 0x33, 0x4d); } else if (strcmp(command, "STOP") == 0) { pc.printf("Stop\n"); + speed.setSpeed(0x0, 0x0, 0x0, 0x0, 0x0, 0x0); t15.stop(); }