How can I make a graph like that from a CSV file stored on a SD Card ?

Im building a temperature logger and I want when the logging finishes to show a graph like that on a i2c 128x64 OLED screen. I found something called Tiny Library but couldnt figure it out on how to implement it in my code :

IF that is what you want help with, supply a link to it.

I am feeling display envy! WANT one of those but it will pass.

http://www.technoblogy.com/show?23OS

It's just 2/3 euros on AliExpress

Sparkfun had an Atmega328p and display as a wearable that was compact. I have one but can't remember the name of it. Does anyone know of it? Might be a better option as it was all in one rather than needing extra circuitry work.

When Ukraine is free, I may return to buy from Putin's material supporters.

3 Likes

Are you using an "ATTiny85"? if not you will need a different library. Look at Adafruit's library.

Then run an example that generates a graph (I'm not sure there is one but I think its likely).

I will not purchase anything from AliExpress for a number of reasons. Just not a company I choose to do business with.

1 Like

3 years ago Aliexpress Judgment decide: i should send counterfeit LM35 back to scammer and when it arrives i get my 1,5€ back. I close my account there. They not delete it.

Yeah I'm not using that chip
I'm using a Mega, DS18B20 RTC and SD card module. My project logs the temps in a CSV file with timestamps until a certain time is reached

There should be a graph example included in the librray. If there isn't, it's time to change libraries. It is essentially a matter of printing a pixel at y=temp, and advancing x by one each time round the loop. The loop looks like 15 seconds, and you are going to have to resolve the temp to 0.5 deg. before you display it.

ATtiny chips are AVR with AVR cores. Pin numbers will change but what gets sent to the display module (and when) will be the same. The amount of work to fit it to another AVR should be far less than writing it new.

I think this code should work with minimal changes on other types of Arduino.

It uses a different technique to writing on the OLED display compared to other Arduino OLED/LCD libraries. I wondered if any available library used this technique, and now you found one.

The Adafruit OLED library uses a large amount of the Arduino's RAM/dynamic memory to store a full size buffer of the display. All drawing is done to the buffer before being sent in in a single update to the display. This is the fastest technique, because updating RAM memory is fast, but it can be a serious problem on many Arduino like Uno, Nano, etc which have limited RAM memory (2KB). Especially if other RAM-hungry libraries are used like for SD card. However, memory should not be a problem on Mega.

The U8G2 library uses some RAM memory for a partial buffer, making it possible to use on Arduino with limited RAM. But it is also slower, because the whole display must be re-drawn several times over to complete the update. (Note: U8G2 can also use a full size buffer, for maximum speed, like the Adafruit library).

But this library, designed for use with ATTINY, uses almost no memory for a display buffer. This is necessary because ATTINY have even less memory than Uno/Nano (0.5KB). The library can do this by using the memory inside the display itself, which none of the other libraries do (ok, they all write to the display's memory, but only this library reads back from it). The downside of this is that it is slower because accessing the memory on the display is far slower than accessing the Arduino/ATTINY's internal RAM memory.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.