Esp32 with Ili9341 and DS18B20

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 612
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Esp32 with Ili9341 and DS18B20

Post by jgu1 »

Hi!

I need help (again). I am starting a project with an Esp32 together with Ili9341 and DS18B20. I want to measure the temperature and log the temp on a graph. It work in real world but I can´t read the temp in simulation, maybe I miss some setting ?

I use the 3.2" display 240X320 To draw the Y axe I use the actual temperature to let the Y go up when temp increase and down again when decrease.

I know the Y axe start on zero in the top of the display and 320 in the buttom. So when the temp increase the graph go in down direction and opposite.

My wish is that the the graph go up when temp increase and down when decrease. Somehow I need to "invert" my tempmeasuring.
How do I do this, please :D

Note, I am not finish with the project so the botton is not active.
Hope you understand the my description. By the way also other improvement is welcome ;)

Thank´s in advance

Br Jorgen.
Attachments
LasertesterESP.fcfx
(36.46 KiB) Downloaded 77 times

chipfryer27
Valued Contributor
Posts: 1143
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 282 times
Been thanked: 412 times

Re: Esp32 with Ili9341 and DS18B20

Post by chipfryer27 »

Hi

I want one of those displays. Amazon or such like will be my next site :D

Not having the chance yet to play with one I can only suggest some things to try. Maybe someone with better knowledge can assist further.

In properties it appears to be able to Flip X and Y (in Hardware) but in simulation this doesn't appear to do anything so I don't know if that would even be of use.

You could however use an offset. In your Live_x Macro you could include a calculation before you plot to include an offset (temp=225-temp) I believe 225 is your lower baseline therefore your plots will now appear to ascend in value rather than descend.

Also, in the same Macro would Plot not be better than DrawLine as it looks like you arent "joining the dots" :) ?

Hope this is of some help.
Regards

jgu1
Posts: 612
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Re: Esp32 with Ili9341 and DS18B20

Post by jgu1 »

Hi Chipfreyer!

Thank you very much. I will test your suggstions. Concening these display, I have made some project with these they are very good. I use the SPI after Bens speed the them up they are very fast.

Do you know why my project not work in simulation?

Br Jorgen

chipfryer27
Valued Contributor
Posts: 1143
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 282 times
Been thanked: 412 times

Re: Esp32 with Ili9341 and DS18B20

Post by chipfryer27 »

Hi Jorgen

I only had a quick look today. I should get more time tomorrow to look further.

It turns out I do already have one of those displays. I ordered up one last year, but as it came with zero documentation it went into the "play later" pile. I've since found a good site that provides help including pinouts and how to change modes (https://wiki.52pi.com/index.php/EP-0065).

Just starting to explore the ESP32 too, so I'm very interested in seeing how they are being used in projects.

Regards

jgu1
Posts: 612
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Re: Esp32 with Ili9341 and DS18B20

Post by jgu1 »

Hi Again!

Flip X 0r Y is like you look in a mirror :D

I try to make some calculations, so far without luck I have to play a little more. Thank´s for help.

Br Jorgen-

chipfryer27
Valued Contributor
Posts: 1143
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 282 times
Been thanked: 412 times

Re: Esp32 with Ili9341 and DS18B20

Post by chipfryer27 »

Hi Jorgen

Looks to me that you might have forgotten to set the device address in your DS18B20 macro. Try adding a AddressSpecificDevice ("000000000000") component macro before you sample.

I included the above and the calculation mentioned earlier and in simulation I can plot.

I'll forward a chart later as FC has just crashed again. It's being doing that recently and generally misbehaving.

Regards

jgu1
Posts: 612
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Re: Esp32 with Ili9341 and DS18B20

Post by jgu1 »

I just set the adress and after read it, forgot that, now it work in simulation. Thank you ;)
It will be easyer to test calculation....

Jorgen

chipfryer27
Valued Contributor
Posts: 1143
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 282 times
Been thanked: 412 times

Re: Esp32 with Ili9341 and DS18B20

Post by chipfryer27 »

Hi Jorgen

In the attached I "spun" the display around in 2D Panel to make it easier for me to read.

In the DS18B20 Macro I added in a command to set the address

I created a new variable called "Plot" and In the Live_x Macro I added a calculation Plot=225-Temp. This then offsets the Temp value with respect to the baseline.

I then use the "Plot" variable in the next command to display the result.

Please note that I haven't went through everything yet as FC is playing up, so the above may not be the best way to achieve. I do hope however it helps.

Regards
Attachments
LasertesterESP_1.fcfx
(37.62 KiB) Downloaded 61 times

jgu1
Posts: 612
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Re: Esp32 with Ili9341 and DS18B20

Post by jgu1 »

Hi Chipfreyer!

Wow, Thank you. I am not Home now, But I Will test later today. Thank`s. :D

Jorgen.

jgu1
Posts: 612
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 506 times
Been thanked: 132 times

Re: Esp32 with Ili9341 and DS18B20

Post by jgu1 »

Hi Chipfreyer!

Yes, it work, so perfect, thanks again. Honest I don´t understand how it work "Plot-225" and how it can icrease the graphhas it something to do with roll over? ;)

Br Jorgen

Post Reply