servo
Dependencies: Servo mbed tsi_sensor SLCD
Diff: main.cpp
- Revision:
- 0:f5fd64350b21
- Child:
- 1:854f2f39affd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Mar 02 17:43:46 2016 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "tsi_sensor.h" +#include "Servo.h" + +//для FRDM-46Z slider +#define ELEC0 9 +#define ELEC1 10 + +DigitalOut gpo(D0); +Servo myservo(D0); +int main() +{ + PwmOut led(LED_GREEN); + TSIAnalogSlider tsi(ELEC0, ELEC1, 40); + + while (true) { + led = 1.0 - tsi.readPercentage(); + myservo=1.0- tsi.readPercentage(); + wait(0.2f); + } +} \ No newline at end of file