new battery bar

Dependencies:   CAN_IDs CanControl Dashboard PinDetect PowerControl mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
kwasymodo
Date:
Sun May 21 22:00:52 2017 +0000
Parent:
5:c90a7b40c930
Child:
13:8e92260c63bd
Child:
14:0ad1bc8be76b
Commit message:
test thread added

Changed in this revision

CanControl.lib Show annotated file Show diff for this revision Revisions of this file
PowerControl.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/CanControl.lib	Fri May 12 20:31:31 2017 +0000
+++ b/CanControl.lib	Sun May 21 22:00:52 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/kwasymodo/code/CanControl/#25258579a80d
+https://developer.mbed.org/users/kwasymodo/code/CanControl/#d7776fa70ef5
--- a/PowerControl.lib	Fri May 12 20:31:31 2017 +0000
+++ b/PowerControl.lib	Sun May 21 22:00:52 2017 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/kwasymodo/code/PowerControl/#1e3291e8294d
+https://developer.mbed.org/users/kwasymodo/code/PowerControl/#54792b95c570
--- a/main.cpp	Fri May 12 20:31:31 2017 +0000
+++ b/main.cpp	Sun May 21 22:00:52 2017 +0000
@@ -35,15 +35,14 @@
 
 // initialze onboard leds
 DigitalOut ledError(LED3);
-DigitalOut ledRelay(LED2);
 DigitalOut ledSD(LED1);
 DigitalOut ledFona(LED5);
 DigitalOut led24V(LED4);
 
 //DigitalOut buckCan(BUCK2);
-//DigitalOut buckXSens(BUCK3);
-//DigitalOut buckScreen(BUCK4);
-//DigitalOut buck24V(BUCK5);
+DigitalOut buckXSens(BUCK3);
+DigitalOut buckScreen(BUCK4);
+DigitalOut buck24V(BUCK5);
 
 
 // Thread 1 - Power
@@ -57,6 +56,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() {  
@@ -72,7 +87,7 @@
     //Thread thread2;
     //Thread thread3;
     //Thread thread4;
-    //Thread thread5;
+    Thread threadx;
     
     // change thread priority
     //thread2.set_priority(osPriorityBelowNormal);
@@ -82,8 +97,14 @@
     //thread2.start(&calcPi);
     //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