Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Mmiscool
#30223 The amount of ram is the same on all esp8266 modules. The only difference is flash size.

If you communicate with the esp over serial @9600 you can use the input command to prompt the PIC for information.

Input is in the form of
Code: Select allinput "TEMPATURE" temp
cls
wprint "Temperature is"
wprint temp
wait

The device will spit the following out the serial port.
Code: Select allTEMPATURE
>


If the pic responds with text or a value followed by a new line character the value or text will be placed in to the temp variable.

Keep in mind that the input command is blocking and the esp will only return a web page once it has hit the wait command.

All variables can be used for numbers or strings. To ad strings you should use the & symbol in stead of the +.

The mid function and len functions are implemented. Left and right are not as of yet.

Spaces are used by the parser to break the code up in to smaller chunks to be used by the interpreter. This is why you can only have one operation for math.
bla = 5 + 5 will work and return 10
bla = 5 + 5 + 5 will return 10 because it only acts on the 2 things.

Check out the language reference
http://www.esp8266basic.com/language-reference.html
for list of functions and commands.

xtal wrote:I have a 16F1825 PIC capturing ppm counts and getting pool temperature and in the future getting PH.
Then send this data over serial port to the esp and update several vars in the esp which will get sent on the next web page refresh to update the web page and display the new updated values. Commands can be sent from web page to PIC
to display additional data...

Using NodeMCU I run out of memory. Have some ESP-13 ordered which are susposed to have more ram...
NodeMCU also uses serial port for logging and does not have any way to stop it which causes problems...

Will your basic include string vars A$, b$ etc and String functions Len, mid$ ,instr, left$, right$ etc. ?
this would be a big +,,,, Is there any reason you use Let A = x verses A=x ????
User avatar
By xtal
#30257 NodeMCU lets you concatenate the vars in the web page statements, for example a html table statement follows,
all the ..xxx.. are concatenated vars. The ESP updates the vars with info from the pic. Then when the page refreshes then new var values are sent. If there is an easier way let me know ;)

C:send('<div><table bgcolor="'..bgc..'" border="1" cellpadding="5">')
C:send('<tr><th>Sensor</th><th>TempC</th><th>TempF</th><th>PPMcntr</th><th>PPM__</th><th>Adj__1</th><th>Adj__2</th></tr>')
C:send('<tr><td>DS18B20'..p00..'</td><td>'..cdeg0..'</td><td>'..fdeg0..'</td><td>'..apc0..'</td><td>'..ppm0..'</td><td>'..ppm1..'</td><td>'..ppm2..'</td></tr>')
C:send('<tr><th>Probe-K</th><th>Pool-PH</th><th>PH-Adj</th><th>ADC Value</th></tr>')
C:send('<tr><td>'..prb..'</td><td>'..ph..'</td><td>'..pha..'</td><td bgcolor="Red">'..adc_value..'</td></tr>')
C:send('</table></div>
User avatar
By xtal
#30258 as for the ram , when I issue node.heap() I always see over 11000 , but it says not enough memory,
User avatar
By xtal
#30261
The mid function and len functions are implemented. Left and right are not as of yet.


you did not mention intsr -- find substring within a string

so how would I start to port over the code ?