nikos chalikias / Mbed 2 deprecated n-DAP_MODBUS_FEEDER_ADC

Dependencies:   mbed Servo USBDevice n-DAP_MODBUS_FEEDER_ADC

Revision:
1:d3ba80dea3dc
Parent:
0:fe1478e69a3b
Child:
2:bb913072aed2
diff -r fe1478e69a3b -r d3ba80dea3dc main.cpp
--- a/main.cpp	Fri Feb 22 16:28:19 2019 +0000
+++ b/main.cpp	Tue May 19 16:23:56 2020 +0000
@@ -8,11 +8,13 @@
 DigitalOut red(P0_20);
 DigitalOut green(P0_21);
 DigitalOut blue(P0_11);
+
 AnalogIn adc1(P0_22); //n-DAP pin 12
 USBSerial serial(0x1f00,0x2012,0x0001,false);// serial over native USB on board (false is non blocking)
 Serial modbus(P0_19, P0_18); // tx, rx
 DigitalOut dir(P0_2);
 PwmOut rcservo(P0_8);
+DigitalOut Vacuum(P0_7);
 
 
 int main() {
@@ -50,7 +52,8 @@
         if (buf[9] == 0x02) { blue = 1;}
         if (buf[9] == 0x03) { green = 0; }
         if (buf[9] == 0x04) { green = 1; }
-        if (buf[9] >  0x00)  {
+        if (buf[9] == 0x04) { Vacuum = 1; }
+        if (buf[9] >  0x05)  {
             angle = buf[9]*4;
             angle = 1000 + angle;
             buf[9] =0;