Test fork nhi
Dependencies: SDFileSystem mbed-rtos mbed emic2
Fork of BAT_senior_design by
Diff: main.cpp
- Revision:
- 32:e87bb6e83072
- Parent:
- 31:e5024aeca3a7
- Child:
- 33:3090ec93b4aa
--- a/main.cpp Fri Nov 17 16:24:33 2017 +0000
+++ b/main.cpp Mon Nov 20 15:46:11 2017 +0000
@@ -1,6 +1,5 @@
#include "mbed.h"
#include "rtos.h"
-#include "wave_player.h"
#include "SDFileSystem.h"
#include "button.h"
#include "buttonArray.h"
@@ -28,11 +27,9 @@
//DigitalOut led3(LED3);
//DigitalOut led4(LED4);
-DigitalIn linpot(p9);
+//DigitalIn linpot(p9);
//Serial pc(USBTX, USBRX);
SDFileSystem sd(p5, p6, p7, p8, "sd"); //SD card
-//AnalogOut DACout(p26);
-//wave_player waver(&DACout);
//button button1(myservo, pb1, linpot);
button button1(myservo, pb1, 1);
button button2(myservo2, pb2, 2);
@@ -73,7 +70,7 @@
{
while(true) {
state2 = button2.updateState();
- Thread::wait(100); // wait till thread is done
+ Thread::wait(200); // wait till thread is done
}
}
@@ -82,7 +79,7 @@
{
while(true) {
state3 = button3.updateState();
- Thread::wait(100); // wait till thread is done
+ Thread::wait(200); // wait till thread is done
}
}
@@ -91,7 +88,7 @@
{
while(true) {
state4 = button4.updateState();
- Thread::wait(100); // wait till thread is done
+ Thread::wait(200); // wait till thread is done
}
}
@@ -100,7 +97,7 @@
{
while(true) {
state5 = button5.updateState();
- Thread::wait(100); // wait till thread is done
+ Thread::wait(200); // wait till thread is done
}
}
@@ -109,7 +106,7 @@
{
while(true) {
state6 = button6.updateState();
- Thread::wait(100); // wait till thread is done
+ Thread::wait(200); // wait till thread is done
}
}
@@ -131,8 +128,6 @@
int main()
{
-
-
// SETUP
// pull up the pushbutton to prevent bouncing
pb1.mode(PullUp);
@@ -145,18 +140,18 @@
// servos begin at 30 degrees
// replace with a button setup function
- //buttonarr.setup();
+ buttonarr.setup();
//led1 = 1;
//led2 = 1;
Thread t1(button_thread);
- //Thread t2(button2_thread);
+ Thread t2(button2_thread);
Thread t3(button3_thread);
Thread t4(button4_thread);
Thread t5(button5_thread);
//Thread t6(button6_thread);
t1.start(button_thread);
- //t2.start(button2_thread);
+ t2.start(button2_thread);
t3.start(button3_thread);
t4.start(button4_thread);
t5.start(button5_thread);
@@ -294,8 +289,6 @@
wait(1);
//pc.printf("hello");
-
-
//WORKS UP TO HERE
char userinput = buttonarr.checkVal();
//pc.printf("userinput: %c", userinput);
@@ -370,7 +363,7 @@
//myTTS.speakf("STo write the letter %s, press pins %D\r",letter[i]);
//myTTS.ready(); //ready waits for speech to finish from last command with a ":" response
-
+ //buttonarr.releaseButtons();
//pc.printf("current braille %c \n", buttonarr.checkVal());
//pc.printf("%c\n", buttonarr.releaseButtons());
