ESP8266 BASIC
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store

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. 
Powered by Create your own unique website with customizable templates.
  • Home
  • Documentation
    • Editor Interface
    • Flashing Instructions
    • Language Reference
    • FAQ
    • Videos
    • Examples
      • ESP8266-projects.com
      • Wifi Station & AP Examples
      • GPIO & PWM & Servo Example
      • GUI Example
      • Hello World Example
      • Graphics Example
      • Blink example
      • I2C READING DS1321 REAL TIME CLOCK
      • Timer Example
      • MSG URL Usage
      • MSG URL (Advanced)
      • DS18B20 Wifi Thermostat
      • CSS Example
      • WIFI Scanner Example
      • Graphic Clock Example
      • Analog Input Graph
  • Flashing Instructions
  • Download
  • Forum
  • Store