Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Servo USBDevice n-DAP_MODBUS_FEEDER_ADC
Diff: main.cpp
- 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;