- Thu Oct 22, 2015 4:41 pm
#32063
Using the following HTMP snippit
Code: Select allcn:send('<form action="" method="POST">\n')
cn:send('<input type="submit" name="pwmi" value="Blink">\n')
cn:send('<input type="submit" name="pwmi" value="Adc">\n')
cn:send('<input type="submit" name="pwmi" value="D">\n')
cn:send('<input type="submit" name="pwmi" value="I">\n')
cn:send('<input type="submit" name="pwmi" value="40">\n')
cn:send('<input type="submit" name="pwmi" value="50">\n')
cn:send('<input type="submit" name="pwmi" value="60">\n')
cn:send('<input type="submit" name="pwmi" value="70">\n')
cn:send('<input type="submit" name="pwmi" value="v">\n')
cn:send('<input type="submit" name="pwmi" value="V">\n')
cn:send('<input type="submit" name="pwmi" value="xx"><br>')
----adding this causes pwmi=&pwmi=
cn:send('CMD<input type="text" name="pwmi" value="">')
cn:send('<input type="submit" value="Entr"></form><br>')
I'm getting 2 responce's per button click IS THIS THE NORM responce
I can extract the individual values Blink, Adc,D etc plus text in cmd box
I need an example of how to set up function call based on value rather than if/elseif
I think maybe table [ie] values stored in vt.cmd and a ? local function to access ?
action = { }
action."Blink" = function(x) img=new_img end,
action."Adc" = function(x) read adc, store in var end,
action."D" = function(x) send D to serial set callback for serial responce, load vars end,
etc
I want to use as little heap as possible
Will anybody help?