Report Bugs Here

Moderator: Mmiscool

User avatar
By heckler
#64138 I am trying to run the following code on an esp8266-01 module with 1meg flash and I am getting the following error message...

Failed to reach end of input expression, likely malformed input
syntax error


This error happens where ever the first oledprint statement is.

I know that the advanced oled functions are only available on modules with 2 meg or more of memory, but I thought that the basic oled functions should still work on the smaller sized ram modules.

oledprint
oledcls
oledsend


I am running ESP Basic 3.0.Alpha 66

thanks
dwight

Code: Select allmemclear
cls
oledcls
counter = 0
time.setup(-7,0)
delay 5000

button "Temperature", [gettemp]
button "Exit ", [Exit]
oled.print "hello",0,0
gosub [gettime]
timer 5000, [gettemp]
wait
'
[gettemp]
counter = counter + 1
if counter = 6 then gosub [gettime]
'
curr = temp(0)
tf = curr * 9
tf = tf / 5
tf = tf + 32
oledPRINT tf,0,0

curr = temp(1)
tf = curr * 9
tf = tf / 5
tf = tf + 32
oledPRINT tf,0,2

'
curr = temp(2)
tf = curr * 9
tf = tf / 5
tf = tf + 32
oledPRINT tf,0,4
'
curr = ramfree()
oledprint curr,0,6
curr = flashfree()
oledprint curr,0,7
'
wait
'
[gettime]
counter = 0
bla = time()
dw = mid(bla,1,3) 'dow
mh = mid(bla,5,3) 'month
dt = mid(bla,9,2) 'date
hh = mid(bla,12,2) 'hour
mm = mid(bla,15,2) 'min
ss = mid(bla,18,2) 'sec
yr = mid(bla,21,4) 'year
oledprint dw,8,0
oledprint mh,8,1
oledprint dt,12,1
oledprint yr,8,2
oledprint hh,8,4
oledprint ":",10,4
oledprint mm,11,4
'
return

[Exit]
end
User avatar
By trackerj
#64163 For a quick test try this piece of code:

Code: Select alllet v = 100
i2c.setup(4,5)
lcdbl 1
oledcls
oledprint "Hello", 0, 0
oledprint v, 3, 3
wait


Change the I2C setup values for your own configuration, I suppose you have something like SDA = GPIO0 and SCL = GPIO2.
User avatar
By heckler
#64173 Nope! (I had to delete the LCDBL 1) and changed the i2c.setup(0,2) [according to the docs sda=0 and scl=2 is default]

But still getting the...
Error at line 4: Failed to reach end of input expression, likely malformed input
Error at line 4: Syntax error


If I go back to the old version 2.0 A24 that is linked to on the download page it works but I have to eliminate the commas as 2.0 A26 dosn't need commas and 2.0 doesn't have 12c.setup
So this works in Ver 2.0a26...
Code: Select alllet v = 100
oledcls
oledprint "Hello" 0 0
oledprint v 3 3
wait


But this does NOT work in the latest 3.x version
Code: Select alllet v = 100
oledcls
oledprint "Hello",0,0
oledprint v,3,3
wait

Does it work for you in a 3.x version?? Specifically on an esp8266-01 module with 1Meg memory.
thanks
dwight
User avatar
By trackerj
#64176
Code: Select alllet v = 100
i2c.setup(4,5)
lcdbl 1
oledcls
oledprint "Hello", 0, 0
oledprint v, 3, 3
wait


is working as expected on a ESP12-E and F
Version : ESP Basic 3.0.Alpha 68

I don't have around any ESP-01 module.