new battery bar
Dependencies: CAN_IDs CanControl Dashboard PinDetect PowerControl mbed-rtos mbed
Diff: main.cpp
- Revision:
- 12:f753bc59c2e8
- Parent:
- 4:dfd10f43cc8b
- Child:
- 20:96420597a848
diff -r b84aec67db5d -r f753bc59c2e8 main.cpp --- a/main.cpp Sun May 21 21:53:39 2017 +0000 +++ b/main.cpp Sun May 21 22:05:25 2017 +0000 @@ -44,6 +44,9 @@ //DigitalOut buckXSens(BUCK3); //DigitalOut buckScreen(BUCK4); //DigitalOut buck24V(BUCK5); +DigitalOut buckXSens(BUCK3); +DigitalOut buckScreen(BUCK4); +DigitalOut buck24V(BUCK5); // Thread 1 - Power @@ -57,6 +60,22 @@ Thread::wait(osWaitForever); } +// Thread X - Test +void test(){ + ledError = 0; + ledSD = 0; + ledFona = 0 ; + led24V=1; + +//DigitalOut buckCan(BUCK2); + buckXSens = 0; + buckScreen = 0; + buck24V = 1; + + + + +} // Thread 0 - DO NOT CHANGE THIS! int main() { @@ -73,6 +92,7 @@ //Thread thread3; //Thread thread4; //Thread thread5; + Thread threadx; // change thread priority //thread2.set_priority(osPriorityBelowNormal); @@ -83,7 +103,14 @@ //thread3.start(&motorTest); //thread4.start(&canReceive); //thread5.start(&relaisOn); + threadx.start(&test); //stop this thread while keeping the other threads running + CANMessage msg; + while(1) { + if(can.read(msg)) { + pc.printf("Message received: 0x %x; %u %u%u %d%d %c %u %u\n", msg.id, msg.data[0], msg.data[1], msg.data[2], msg.data[3], msg.data[4], msg.data[5], msg.data[6], msg.data[7]); + } + } Thread::wait(osWaitForever); -} \ No newline at end of file +}