Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By trackerj
#65205 You can find below a quick example on how to use CSS, even without using a separate CSS file:

Code: Select alltextbox Dtm
cssid htmlid(), "background-color: yellow;display:block;width:160px"


Off course you can change even more attributes, like font color, size, background color, etc.

Full code example, tested with a DHT22 on GPIO 5 can be found here: http://www.esp8266-projects.com/2017/04/espbasic-web-interface-css-elements.html

This is how is looking the result:

Image
User avatar
By trackerj
#65216 Take a look at the full code example, might help you to find the error you have:
http://www.esp8266-projects.com/2017/04/espbasic-web-interface-css-elements.html
User avatar
By Pierre
#65362 Hi TJ

Thanks for the info so far. I am currently desperately in need of help as I am not sure what I am doing and I am running into a lot of trouble with my project.

When my code were a small number of lines, your CSS code worked perfectly. I first started with switching only one of the lights automatically, but as I added more code, the program became very unstable. Sometimes it works perfectly and other times the ESP crash and restart. My first question is that I get a funny error when I save the program :

Connected to HUAWEI-E5330-3C6C
IP address : 192.168.8.40
WIFIname
WIFIpass
start sending
End of Open
Done...
Error at line 0:
Error at line 0: Halted
start save
Error at line 0:
Error at line 0: Halted
/default.bas/25
/default.bas/45
/default.bas/71
/default.bas/117
/default.bas/143
/default.bas/151
/default.bas/165
end of save!!
Error at line 0:
Error at line 0: Halted

What does the Error at line 0: mean, as the program does save correctly.

Sometimes the program works correctly and then I see the following :

þHTTP Port: 80
ESP Basic 3.0.Alpha 69
MAC: A2:20:A6:01:C4:91
1
2

Connected to HUAWEI-E5330-3C6C
IP address : 192.168.8.40
WIFIname
WIFIpass
TimeZone
DaylightSavings
0 winsock connected 192.168.8.102

When it crash I see the following :

TimeZone
DaylightSavings

Exception (28):
epc1=0x4000bf0e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3fff3100 end: 3fff3550 offset: 01a0

>>>stack>>>
3fff32a0: 00000000 3fff3388 3fff32d0 4022be6c
3fff32b0: 00000000 3fff3388 3fff1ce4 4022beae
3fff32c0: 3fffb3f4 3fff3388 3fff1ce4 4020b5fe
3fff32d0: 00000000 00000000 00000000 3fff8204
3fff32e0: 00000a7f 00000a72 3fff3388 4022be6c
3fff32f0: 00000000 00000000 3fff163c 4022be94
3fff3300: 00000000 00000000 3fff163c 40218fc9
3fff3310: 3fffaba4 0000000f 00000006 3fff76dc
3fff3320: 0000000f 0000000a 3ffface4 0000000f
3fff3330: 00000000 3fffabd4 0000000f 00000000
3fff3340: 3fffaf24 0000000f 00000000 3fffb0dc
3fff3350: 0000000f 00000000 3fffaf8c 0000000f
3fff3360: 00000000 3fffab3c 0000000f 00000000
3fff3370: 3fffadd4 0000000f 00000000 3fffb264
3fff3380: 0000000f 00000000 3fffa09c 0000004f
3fff3390: 00000045 00000000 00000000 00000000
3fff33a0: 00000000 00000000 00000000 3fffb3f4
3fff33b0: 0000005f 00000045 00000000 4010053d
3fff33c0: 3fff567c 3fff3440 3fff3440 4022bce4
3fff33d0: 00000010 00000001 3fff3440 3ffeffb0
3fff33e0: 00000010 3fff3440 3fff3440 4022bce4
3fff33f0: 3ffe8e2c 00000000 3fff3440 3fff2518
3fff3400: 3fff491c 0000000f 00000000 3fffafdc
3fff3410: 0000000f 00000000 3fff737c 0000000f
3fff3420: 00000000 3fffaed4 0000000f 0000000a
3fff3430: 3fffad84 0000000f 00000006 3fffae84
3fff3440: 0000000f 00000006 3fff349c 4022bd33
3fff3450: 00000000 00000711 00000000 00000000
3fff3460: 3fffdad0 3fff13c4 3fff3490 4010068c
3fff3470: 3ffe8e2c 3fff13c4 3fff1c94 3fff2524
3fff3480: 3fffdad0 3fff13c4 3fff1c94 4021bbcb
3fff3490: 00000000 00000000 00000000 00000000
3fff34a0: 00000000 00000000 3fff08d8 402296f0
3fff34b0: 00000001 00000000 00000000 4021be2b
3fff34c0: 00000000 3fff34e0 3fff5d20 40220234
3fff34d0: 00000001 3fff5d20 3fff5cfc 40221836
3fff34e0: 3ffe95a0 00000000 000003e8 3fff2530
3fff34f0: 00000000 00000000 00000000 3fff2524
3fff3500: 3fffdad0 00000000 3fff251c 4021bebb
3fff3510: 00000000 feefeffe feefeffe feefeffe
3fff3520: 00000000 00000000 00000001 40229a81
3fff3530: 3fffdad0 00000000 3fff251c 40229aac
3fff3540: feefeffe feefeffe 3fff2530 40100718
<<<stack<<<
HåÖÔ
ôDH+HTTP Port: 80
ESP Basic 3.0.Alpha 69
MAC: A2:20:A6:01:C4:91
1
2
3
4

Connected to HUAWEI-E5330-3C6C
IP address : 192.168.8.40
WIFIname
WIFIpass

I really do not where to look or what to do. I have commented some lines out as it seems more stable when they are not executed. These are there to automatically switch the third light.

Regards
Pierre