Did you load it on a module and try and run it? If so what was the error message? Then if you look at the line number in question you will find a clue to the problem.
I got it working by changing just two lines (adding commas... which is a major difference between 2.x and 3.x [commas])
below the code now works for me.
see if you can find the two lines 32 and 41.
Note: a good way to find the numbered lines is to look at the code in the "Debug" tab, then go back to the edit window to correct it. (not sure if you can edit in the debug window)
hope this helps
dwight
' BIG COLOURED TOGGLE BUTTON
let ledpin = 13 ' Sonoff LED pin, change to suit for others
let relaypin = 12 ' Sonoff Relay pin, change to suit for others
let ledlogic = 1 'Default led pin off state (allows configuring led pin for active high or active low operation)
let relaylogic = 0 'Default relay pin off state (allows configuring relay pin for active high or active low operation)
io(po,ledpin,ledlogic)
io(po,relaypin,relaylogic)
[HOME]
cls
wprint "<BR><BR><BR><BR><BR><BR>"
wprint |<!DOCTYPE html>|
wprint |<html>|
wprint |<head>|
wprint |<style>|
wprint | .button, input[type="button"], input[type="submit"] { |
wprint | display: inline-block;|
wprint | padding: 15px 25px;|
wprint | font-size: 32px;|
wprint | cursor: pointer;|
wprint | text-align: center;|
wprint | color: #fff;|
if io(laststat,relaypin)=0 then wprint |background-color: #4CAF50;| else wprint |background-color: #f44336; /* Red */|
wprint | border: 2px solid black;|
wprint | border-radius: 15px;|
'wprint | box-shadow: 0 9px #999;|
wprint |}|
wprint |</style>|
wprint |</head>|
wprint |<body>|
wprint |<div style="text-align: center;">|
if io(laststat,relaypin) = 0 then button "ON",[TOGGLE] else button "OFF",[TOGGLE]
wprint |</div>|
wprint |</body>|
wprint |</html>|
wait
[TOGGLE]
if io(laststat,relaypin) = 0 then io(po,relaypin,1) else io(po,relaypin,0)
if io(laststat,ledpin) = 0 then io(po,ledpin,1) else io(po,ledpin,0)
goto [HOME]
' - See more at: http://www.esp8266.com/viewtopic.php?f=40&t=10130#sthash.0ZqbGHMh.dpuf