Team Kryptonite EE300 Keypad Subsystem

Dependencies:   keypad mbed

Fork of mbed_can_bus_test1 by Kryptonite

Files at this revision

API Documentation at this revision

Comitter:
Googlesomething
Date:
Fri Nov 03 14:18:33 2017 +0000
Child:
1:907c82f7f923
Commit message:
Rough Commit, Needs case structure written for setup choices and a main function

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 03 14:18:33 2017 +0000
@@ -0,0 +1,77 @@
+#include "mbed.h"
+
+Ticker ticker;
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+CAN can1(p9,p10);
+CAN can2(p30,p29);
+
+//Declare KeyPad GPIO pins here
+
+
+
+//Universal ID: 1337
+//CAN Message Info
+char counter        = 0;    //keypad system CAN test variable
+char start          = '*';  //Start
+char stop           = '#';  //Stop
+char amp5           = 5;    //Digipot
+char amp4           = 4;    //Digipot
+char amp3           = 3;    //Digipot
+char amp2           = 2;    //Digipot
+char amp1           = 1;    //Digipot
+char squareWave     = 'q';  //DAC
+char sinWave        = 'w';  //DAC
+char oneHertz       = 'o';  //DAC
+char tenHertz       = 't';  //DAC
+char saveUSB        = 'u';  //ADC
+char saveLocal      = 'l';  //ADC That's an l as in labeorphily
+
+
+
+//CAN Send (Parameter = message data) 
+void send(char sendMsg) {
+    if(can1.write(CANMessage(1337, &sendMsg, 1))) {
+        printf("Message sent: %d\n", sendMsg);       
+    }
+    led1 = !led1;
+}//Still gunna send it, make sure you understand how to call send with params
+
+/* write Switch statements*/
+//Setup Choice Switch Statements
+void setupCase() {
+    switch(setupChoice) {
+   case 1  ://DAC Setup
+      statement(s);
+      break; //optional
+      
+   case 2  ://DigiPot Setup
+      statement(s);
+      break; //optional
+      
+   case 3  ://ADC Setup
+      statement(s);
+      break; //Optional
+      
+      
+   default : //Optional
+      statement(s);
+}
+    }
+
+//WTF is this, fix it
+/*
+int main() {  
+    printf("Please select the desired function:\n1: DAC Setup\n2: DigiPot Setup\n3: ADC Setup\n");
+
+    ticker.attach(&send, 1);
+    CANMessage msg; 
+    while(1) {
+        if(can2.read(msg)) {
+            printf("Message Recieved: %d\n\n", msg.data[0]);
+            led2 = !led2;
+        }
+    wait(0.2);
+    }
+}
+*/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 03 14:18:33 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file