diff --git a/I2C/.cproject b/I2C/.cproject
index 44e7a32..f2f2838 100644
--- a/I2C/.cproject
+++ b/I2C/.cproject
@@ -42,13 +42,14 @@
-
-
+
@@ -64,29 +65,31 @@
-
-
-
-
+
+
+
-
-
-
+
+
@@ -140,14 +143,15 @@
-
-
-
+
+
@@ -163,29 +167,31 @@
-
-
-
-
+
+
+
-
-
-
+
+
@@ -239,4 +245,5 @@
LPCXpresso1549
+
\ No newline at end of file
diff --git a/I2C/.project b/I2C/.project
index 4afcb42..f9ac250 100644
--- a/I2C/.project
+++ b/I2C/.project
@@ -4,6 +4,7 @@
lpc_chip_15xx
+ DigitalIoPin
diff --git a/LiquidCrystal/.cproject b/LiquidCrystal/.cproject
index 9880c25..432a907 100644
--- a/LiquidCrystal/.cproject
+++ b/LiquidCrystal/.cproject
@@ -246,4 +246,5 @@
LPCXpresso1549
+
\ No newline at end of file
diff --git a/StateHandler/.cproject b/StateHandler/.cproject
index dce4dd8..289e85d 100644
--- a/StateHandler/.cproject
+++ b/StateHandler/.cproject
@@ -252,4 +252,5 @@
LPCXpresso1549
+
\ No newline at end of file
diff --git a/esp-vent-main/.cproject b/esp-vent-main/.cproject
index 424e11a..521b9f6 100644
--- a/esp-vent-main/.cproject
+++ b/esp-vent-main/.cproject
@@ -45,6 +45,7 @@
+
@@ -73,6 +74,7 @@
+
@@ -91,6 +93,7 @@
+
@@ -122,6 +125,7 @@
+
@@ -194,6 +199,7 @@
+
@@ -222,6 +228,7 @@
+
@@ -240,6 +247,7 @@
+
@@ -271,6 +279,7 @@
+
diff --git a/esp-vent-main/.project b/esp-vent-main/.project
index 83a2e6e..e653829 100644
--- a/esp-vent-main/.project
+++ b/esp-vent-main/.project
@@ -9,6 +9,7 @@
LiquidCrystal
I2C
StateHandler
+ Timer
diff --git a/esp-vent-main/esp-vent-main LinkServer Debug.launch b/esp-vent-main/esp-vent-main LinkServer Debug.launch
new file mode 100644
index 0000000..e0615e3
--- /dev/null
+++ b/esp-vent-main/esp-vent-main LinkServer Debug.launch
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/esp-vent-main/src/esp-vent-main.cpp b/esp-vent-main/src/esp-vent-main.cpp
index aa6a5d4..231a6aa 100644
--- a/esp-vent-main/src/esp-vent-main.cpp
+++ b/esp-vent-main/src/esp-vent-main.cpp
@@ -17,6 +17,7 @@
#endif
#include "DigitalIoPin.h"
+#include "LiquidCrystal.h"
#include "StateHandler.h"
#include
@@ -40,34 +41,54 @@ main (void)
Board_LED_Set (0, true);
#endif
#endif
+ /** Lcd & stateHandler */
+ Chip_RIT_Init (LPC_RITIMER);
+ DigitalIoPin rs (0, 29, false, true, false);
+ DigitalIoPin en (0, 9, false, true, false);
+ DigitalIoPin d4 (0, 10, false, true, false);
+ DigitalIoPin d5 (0, 16, false, true, false);
+ DigitalIoPin d6 (1, 3, false, true, false);
+ DigitalIoPin d7 (0, 0, false, true, false);
+ LiquidCrystal lcd (&rs, &en, &d4, &d5, &d6, &d7);
+ StateHandler ventMachine (&lcd);
+ //
+ lcd.setCursor (0, 0);
+ lcd.print ("Test");
- DigitalIoPin b_up ();
- DigitalIoPin b_down ();
- DigitalIoPin b_toggle ();
- bool b_up_state = false, b_down_state = false, b_toggle_state = false;
-
- StateHandler ventMachine;
+ /** Common pins */
+ DigitalIoPin b_up (0, 7, true, true, true); // A5
+ bool b_up_state = false;
+ DigitalIoPin b_down (0, 6, true, true, true); // A4
+ bool b_down_state = false;
+ DigitalIoPin b_toggle (0, 5, true, true, true); // A3
+ bool b_toggle_state = false;
int16_t pressure = 1;
while (1)
{
if (b_up.read ())
- b_up_state = true;
+ {
+ b_up_state = true;
+ }
if (!b_up.read () && b_up_state)
{
ventMachine.HandleState (Event (Event::eKey, BUTTON_CONTROL_UP));
b_up_state = false;
}
if (b_down.read ())
- b_down_state = true;
+ {
+ b_down_state = true;
+ }
if (!b_down.read () && b_down_state)
{
ventMachine.HandleState (Event (Event::eKey, BUTTON_CONTROL_DOWN));
b_down_state = false;
}
if (b_toggle.read ())
- b_toggle_state = true;
+ {
+ b_toggle_state = true;
+ }
if (!b_toggle.read () && b_toggle_state)
{
ventMachine.HandleState (