Projects 7


Jason sent us this example for a data logger --> to Excell with ESP32forth.

First off, I needed to grab ADC values, and as is customary for me, I like to average them out a little. After some tinkering, I settled on this bit of code:

: DECADC 10 0 DO 34 adc LOOP 9 0 DO + LOOP 10 / . ;

The LDR is connected to pin 34, thus, "34 adc" to read the analog value from pin 34.

Then I cooked up a delay loop:

: delay 0 DO LOOP ;

Finally, I stuck it together in a little loop that allows me to write out values so I can import it as CSV into Excel, which helps me model the data and figure out what I want to do with it:

: SLOADC CR 0 DO DECADC CR 250000 delay LOOP ;

which I can then run thus: 100 SLOADC

which in turn gives me the data in the images you see.

[LCD DRIVER 8bit parallel project 72]

LCD DRIVER by Tony Leff.

Participate in our monthly ZOOM meeting , show what you do with ESP32forth !

Every 2nd Saturday of the month.

Contact our FB page Forth2020 Group