Report Bugs Here

Moderator: Mmiscool

User avatar
By xtal
#32795 Ipage = 'http://i.imgur.com/KS1dPa7.png'
B_Opn = 'http://i.imgur.com/kzt3tO8.png'
B_Clo = 'http://i.imgur.com/KS1dPa7.png'

[BLINK]
if len(Ipage) = len(B_Clo) then Ipage = B_Opn else Ipage = B_Clo
wait
This did not change Ipage so I changed to:
if Ipage == B_Clo then Ipage = B_Opn else Ipage = B_Clo
This also did not work !!!! I page does not change
---------------------------------------------------------------------------
wprint "<td><IMG SRC="
wprint htmlvar(Ipage) ----->>> this did not work wprint |Ipage| - this worked
wprint " LEFT='1' WIDTH='120' HEIGHT='60' BORDER='1'></td>"

Read ADC AI(adc_value) not work adc_value = AI prints as AI
How do I read ADC

AI adc_value finally worked .....

HAD TO USE wprint htmlvar(adc_value) on the ADC display IS IT FOR NUMERIC ONLY

Changed t{BLINK} to:
[BLINK]

if c_cnt=1 then Ipage = B_Opn
if c_cnt=2 then Ipage = B_Clo
c_cnt = c_cnt +1
if c_cnt=3 then c_cnt=1
SERIALPRINTLN c_cnt
SERIALPRINTLN Ipage
wait

It prints out c_cnt instead of a value and Ipage doesn change
Is there something wrong with c_cnt
I guess this thing can't count :mrgreen:
Last edited by xtal on Sun Nov 01, 2015 9:22 pm, edited 1 time in total.
User avatar
By Mmiscool
#32801 I like the fact that you re still attempting to get things working with esp8266 basic. It seems that your code causes me to fix many bugs in the interpreter code.

Download the latest version. Just had to fix a bug in the if then code that caused a problem with the case of the variable name. This has been corrected now.

Just uploaded the new version.

Code: Select allIpage = 'http://i.imgur.com/KS1dPa7.png'
B_Opn = 'http://i.imgur.com/kzt3tO8.png'
B_Clo = 'http://i.imgur.com/KS1dPa7.png'
wprint "<td><IMG SRC="
wprint htmlvar(Ipage)
wprint " LEFT='1' WIDTH='120' HEIGHT='60' BORDER='1'></td>"
button "click me" [branch.to.exicute.action]
wait


[branch.to.exicute.action]
if Ipage == B_Clo then Ipage = B_Opn else Ipage = B_Clo
wait
User avatar
By xtal
#32802 Can't count or display the count ? see prior post will try new fw using 1.05 now
Good news v1.08 didn't break it

#1 the compare is working I still must use wprint |Ipage| to display the picture however the displayed picture is not changing there must be a hidden value of Ipage , is web page caching in use? :roll:

#2 the htmlvar does work with the adc_value [numeric]
does not work with Ipage [string value]

#3 cannot seem to use cnt = cnt +1 & serialprintln prints cnt not the value of cnt

#4 using serial print the last thing printed is printed again when refresh [button msg]
The [BLINK] code appears to execute if it was the last serialprintln [ie] Ipage changes per serialprintln

#5 last button code appears to be re-executing on refresh Ipage changes, adc changes

#6 How do you REMARK code?

#7 I can change Ipage, but cannot change image??????????????????????????? need htmlvar to work on string ??

if Ipage == B_Clo then Ipage = B_Opn else Ipage = B_Clo -------works Ipage varies per serialprintln
if cnt == "1" then SERIALPRINTLN "1" ---------------------------- prints same time as == 2
if cnt == "2" then SERIALPRINTLN "2" ---------------------------- prints same time as == 1
if cnt == "2" then cnt = "1"
SERIALPRINTLN Ipage

Also tried this code in [submit.branch]

[SUBMIT.BRANCH] Result
SERIALPRINTLN mycommand --------------------
SERIALPRINTLN Ipage 'http://i.imgur.com/KS1dPa7.png'
SERIALPRINTLN cnt cnt 4
SERIALPRINTLN adc_value 512

cnt = 0
serialprintln cnt+41 cnt+41
cnt = cnt+42
serialprintln cnt cnt 42
cnt = cnt+1
serialprintln cnt cnt 1
cnt = cnt+2
serialprintln cnt cnt 2
cnt = cnt+3
serialprintln cnt cnt 3
cnt = cnt+4
serialprintln cnt cnt 4
wait


Also tried this code in [submit.branch] RESULT

for x = 0 to 5
if x = 0 then serialprintln "0" printed 0
if x = 1 then serialprintln "1" printed 1 [after 15 sec page refresh]
if x = 2 then serialprintln "2" printed 2 [after 15 sec page refresh]
if x = 3 then serialprintln "3" printed 3 [after 15 sec page refresh]
if x = 4 then serialprintln "4" printed 4 [after 15 sec page refresh]
if x = 5 then serialprintln "5" printed 5 [after 15 sec page refresh]
next x

appears that only 1 step per wait / refresh ??????? I don't think this is a good feature.....