Chat freely about the open source Javascript projects for ESP8266

User avatar
By hygy
#32011 Can we create an example page somewere? I think little examples. So If somebody create a new type of code with a new type of hardware or new module/part in esrpuino on esp8266, then put somewhere the code, or the main part of the working code, to help others with usage examples. I think that will help much to promote the espruino system. And promote the esp8266 board.
The more people use the system it will be more stable and better and popuplar.
And I think that will be good if somebode use a ready hardware or create a new board and schematic than this can be but the brd, and sch here or privode a link to the source of hardware (shield). Eg if you create a volgate meter for a car battery, put here the schema brd and example code for the voltage meter module.

What do you think?
User avatar
By kolban
#32027 I'm all in favor of examples ... however ... maybe they already exist?

The port of Espruino to the ESP8266 is exactly that .... a port. Which means that, in principle, everything that already works today on Espruino on other boards should work just fine on the ESP8266 port.

If we look at the Espruino home page found here ...

http://www.espruino.com/

We find a link at the top called "Documentation" and it seems to have a large "Tutorials and Examples" set of pages.

Could this be what you are looking for?

A program written in JavaScript for Espruino should work just the same on all boards that Espruino works upon.
User avatar
By xtal
#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 ? :mrgreen:
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 :mrgreen:
Will anybody help?
User avatar
By kolban
#32082 @xtal,
Did you by chance post in the wrong forum? This forum is about running JavaScript on the ESP8266s. There are separate forums on running and writing apps in Lua at this community site.