dinsdag 5 juli 2016

ESP8266 Basic Test OutputPins program

I created a ESP8266 Basic Output test program to control the output pins of this ESP Wifi testboard flashed with ESP8266Basic.
Running the program gives a HTML page to control the output pins of this test board. 
Screendump
Pin 0 , 2 ,4 ,5, 14 and 16 can be set Low (0) or High (1) 
Clicking the button immedeate changes the state.
On this ESP8266 test board Red leds will light if the signal is set to Low

Pin 12 , 13 and 15 are configured as PWM output pins and are controlled by the sliders. Pressing the SetSliders button send the PWM values to the output port. Pressing SlidersOff sets al the PWM values to 0
On the RSP8266 test board it is used to control the RGB led.
' Test program version 0.1 - 20160630
cls
pw12=0
pw13=0
pw15=0
html | <h1>Test Pin Output</h1> |
html | <table> |
html | <tr><td> |
button "Set Pin  0 Low" , [SetPin0Low]
html | </td><td> |
button "Set Pin  0 High", [SetPin0High]
html | </td></tr><tr><td> |button "Set Pin  2 Low" , [SetPin2Low] 
html | </td><td> |
button "Set Pin  2 High", [SetPin2High] 
html | </td></tr><tr><td> |
button "Set Pin  4 Low" , [SetPin4Low] 
html | </td><td> |
button "Set Pin  4 High", [SetPin4High] 
html | </td></tr><tr><td> |
button "Set Pin  5 Low" , [SetPin5Low] 
html | </td><td> |
button "Set Pin  5 High", [SetPin5High] 
html | </td></tr><tr><td> |
button "Set Pin 14 Low" , [SetPin14Low] 
html | </td><td> |
button "Set Pin 14 High", [SetPin14High] 
html | </td></tr><tr><td> |
button "Set Pin 16 Low" , [SetPin16Low] 
html | </td><td> |
button "Set Pin 16 High", [SetPin16High]
html | </td></tr><tr><td>Pin 12: |
slider pw12 , 0 , 500
html | <br>Pin 13: |
slider pw13 , 0 , 500
html | <br>Pin 15: |
slider pw15 , 0 , 500
html | </td><td> |
button "SetSliders" , [SetSliders]
html | <br> |
button "SlidersOff" , [SlidersOff] 
 html | </td></tr><tr><td> </td><td> |
button "  Exit  ", [Exit] 
html | </td></tr></table> |
wait 

[SetPin0Low] 
io(po,0,0) 
wait 
[SetPin0High] 
io(po,0,1) 
wait 

[SetPin2Low] 
io(po,2,0) 
wait 
[SetPin2High] 
io(po,2,1) 
wait 

[SetPin4Low] 
io(po,4,0) 
wait 
[SetPin4High] 
io(po,4,1) 
wait 

[SetPin5Low] 
io(po,5,0) 
wait 
[SetPin5High] 
io(po,5,1) 
wait 

[SetPin14Low] 
io(po,14,0) 
wait 
[SetPin14High] 
io(po,14,1) 
wait 

[SetPin16Low] 
io(po,16,0) 
wait 
[SetPin16High] 
io(po,16,1) 
wait

[SlidersOff] 
pw12 = 0
pw13 = 0
pw15 = 0
[SetSliders] 
io(pwo,12,pw12)
io(pwo,13,pw13)
io(pwo,15,pw15)
wait 
[Exit] 
end

Geen opmerkingen: