maandag 1 augustus 2016

ESP8266Basic Servo test

ESP8266Basic has built in function for servo control.
Pin ServoA is ESP8266 pin where signal servo is connected.

Servo    ESP8266
Brown   GND
Red       VCC
Yellow  Signal

- Sorry for color of the Dupont cables on photo between ESP8266 module and the servo, exact with servo matching colors are in other projects.
- At some values of  ServoA the servo is not sot stable and shaking a little bit.
- Values below 0 and higher than 180 ( with > or < buttons ) are not prevented.

' TestServoA version 0.1
' ESP8266Basic program for testing a servo's
' On some values my servo is not stable and keeps moving
' servo 0 - 100 not full angele

PinServoA = 5

html | <h1>Demo ServoA </h1>|
html | <table><tr><td><center> |

button "Servo0" , [Servo0]
html | </center></td><td><center> |

button "Servo90" , [Servo90]
html | </center></td><td><center> |

button "Servo180" , [Servo180]
html | </center></td></tr><tr><td><center> |

button " < " , [ServoBW]
html | </center></td><td><center> |

' ESP8266Basic Manual says needt to be between 0 and 180 (=degrees)
slider ServoA , 0 , 180
html | </center></td><td><center> |

button " > " , [ServoFW]
html | </center></td></tr><tr><td> |

html | <br> |
html | </td><td><center> |

button "SetServo" , [SetServo]
html | </center></td><td><center> |

button " Exit ", [Exit]
html | </center></td></tr></table> |
wait


[Servo0]
ServoA = 0
Goto [SetServo]

[Servo90]
ServoA = 90
Goto [SetServo]

[Servo180]
ServoA = 180
Goto [SetServo]

[ServoBW]
ServoA = ServoA - 1
Goto [SetServo]

[ServoFW]
ServoA = ServoA + 1
Goto [SetServo]

[SetServo]
io(servo,PinServoA,ServoA)
wait

[Exit]
end


Screendump :

Geen opmerkingen: