Controlling I/O pins and Servos (3.0 branch only)
cls
let pinNo = 0 let pinStat = 0 print "Pin Number" textbox pinNo print "Pin Stat" textbox pinStat button "Set Pin", [SetThePin] button "Set Pin PWM", [SetThePinPWM] button "Set Servo", [SetThePinServo] button "Exit", [TestExit] wait [SetThePin] io(po,pinNo,pinStat) wait [SetThePinPWM] io(pwo,pinNo,pinStat) wait [SetThePinServo] io(servo,pinNo,pinStat) wait [TestExit] end |
This is a simple program that produces a gui that allows you to control any of the GPIO pins.
Enter the pin number and the status. For the set pin button use a 1 or 0 for the status representing high or low. For PWM enter a number between 0 and 1023 for the PWM value. This will pulse the pin on or off varying the time it is on or off based on the value and can be used for dimming a light or the speed of a motor. To use the servo enter a number between 0 and 180 to move the servo motor to the desired position. |