Arduino Graph Drawing - FREE CODE!!!

Поделиться
HTML-код
  • Опубликовано: 25 дек 2015
  • Do you want to a graph on a Cartesian coordinate system on your LCD but don't want to write the code? Use mine for free. This code includes a function do plot your data on a graph. This function works with Arduino UNO or MEGA, and an Adafruit 3.5 inch 320 x 480 LDC display. This code may work with other displays that use the Adafruit_GFX libraries.
    .ino files can be downloaded here
    Follow the link to GitHub, click the green button that says File and select the Download ZIP option
    NOTE: there are 2 examples (cartesian graph like in the video Graph.ino, and bar charts in Graphing.ino
    github.com/KrisKasprzak/Graph...
    Link to the Adafruit LCD display and libraries
    learn.adafruit.com/adafruit-3...
  • НаукаНаука

Комментарии • 190

  • @ekanayake100
    @ekanayake100 2 года назад +1

    One of the best I have seen. Wish Kris well!

  • @franciscomoren0
    @franciscomoren0 8 лет назад +1

    Wow, I love your videos. Very educational. Two thumbs up!!!

  • @Lenigan96
    @Lenigan96 6 лет назад +2

    Mr Kasprzak great video and thanks for the code!

  • @zylascope
    @zylascope 7 лет назад +2

    That's perfect for my project, thanks Kris!

  • @laszlovona
    @laszlovona 3 года назад +3

    Man. this is really professional work! I truly appreciate the effort you put into the code and the video. Not to mention, that you shared it for free :). I modified it a bit here and there and it works great with my crap chinese tft+nano as well. //I am creating an air compressor remote monitoring stuff to my workshop and first I was a bit relcutant to interface the parallel TFT to the nano board and do all the trickery within 32k flash, but it seems to work so far (I am at 93% pgm haha). Thank you again!

    • @fauldubz4670
      @fauldubz4670 3 месяца назад

      would you be willing to share your tweaks to make it work on a nano with a chinese tft?

  • @enderq666
    @enderq666 5 лет назад

    Kasprzak! That sounds like the old fashion polish radio from Unitra :-) Great video, thanks for sharing code

  • @arducoding9471
    @arducoding9471 11 месяцев назад

    thank Mr. Kris, this is very useful for me. I implemented this function in ILI9341 display and its working perfectly.

  • @VeryMuchBlessed
    @VeryMuchBlessed 6 лет назад +11

    Amazing. Totally brilliant. Thanks for this video.

  • @ashrafatteya
    @ashrafatteya 4 года назад

    Thank you so much Mr.Kris .
    Amazing video

  • @destinylimas8684
    @destinylimas8684 5 лет назад +6

    Amazing video! Just one question: Can the code be modified to be used with a standard lcd or simply on the serial plotter

  • @daredevile28
    @daredevile28 7 лет назад +4

    Thank you very much. With your share code i built industrial machine that i use in my company, 4 months ago. You are my first teacher.. thank you..

  • @sandih.p3791
    @sandih.p3791 5 лет назад +1

    Thank you so much Mr.Kris 🙏 you very help me for my project

  • @billglass5160
    @billglass5160 Год назад

    Very good job! Question: I'd like to display a frequency response of an audio signal. X-axis from 0 to 22050 Hz. Y-axis from -90dB to 0dB. I have a pure sine wave at 440Hz that I am analyzing with a 16384-point fft. The width of the spectrum is 440 +- 15Hz. Before I order the suggested display, do you think there's enough resolution to see that 440Hz spectrum with only 320x480 pixels? Thanks

  • @jesperkleemann1333
    @jesperkleemann1333 5 лет назад

    Thumb up! Thank you, it is a great help for an autodidakt nerd, like me, to study and use your code. Have a nice time, everybody!

  • @wimbrussee501
    @wimbrussee501 5 лет назад +2

    Hi Chris
    I am very happy with the sketch it works perfectly
    I tried to use it for temperature measurement A0 0-5V 0-100 gr.Celsius but I did not succeed
    Could you help me with that

  • @lexee50
    @lexee50 6 лет назад

    Would it be possible to share the fritzing diagram. Thankyou

  • @mizouman
    @mizouman 7 лет назад +2

    wow impressive work, thank you very much for sharing it

  • @pm2172
    @pm2172 6 лет назад

    Thanks for the reply kris. Option 1 would be great, and tips on how to go about this would be greatly appreciated.

  • @bryanttaylor6048
    @bryanttaylor6048 3 года назад +2

    How do you make the Temperature graph write over the old data without redrawing the graph? I am using an Arduino MEGA with an Adafruit 3.5 inch 320 x 480 display using SPI. I have the temperature graph running in my program but when the data gets to the end, the graph is redrawn for the next pass. This takes up to much time in my application.

  • @bc-ti4bq
    @bc-ti4bq 4 года назад

    Very handy. Thank you for sharing.

  • @makespace8483
    @makespace8483 3 года назад

    Nice! And helpful. Thanks!

  • @shafiqalom8408
    @shafiqalom8408 3 года назад +1

    Amazing graph drawing ♥️

  • @GhostStop
    @GhostStop 6 лет назад

    Any chance someone knows how to get this to work on an Elegoo EL-SM-004? I get the white screen.

  • @nickfarmakidis5319
    @nickfarmakidis5319 7 лет назад +3

    This is looking awesome. Thanks a bunch! One question: Could you save the data you are plotting on your computer? (say by appending a .txt file) Thanks again

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад

      You could, you would write this to the serial port (Serial.println(xxxx), then write a program on the PC to read that serial data. Or save the plot data to and SD card and bring that into the PC.

    • @nickfarmakidis5319
      @nickfarmakidis5319 7 лет назад

      Thanks a bunch, I think I'll go with the first option. Thanks again

  • @OAlexisSamaO
    @OAlexisSamaO Год назад +1

    massive thanks, this will be extremely useful for my project

  • @andrewjudd7499
    @andrewjudd7499 6 лет назад

    Looks Great just what i need, thank you so much

  • @jameschurches663
    @jameschurches663 7 лет назад

    The graphs appear mirrored on the two displays I've tested this code,
    the set rotation function just rotates and does not fix - any ideas?

  • @MrKubitron
    @MrKubitron 8 лет назад

    Is there any way to draw graph straight to png/jpg image on sd card?

  • @kareca18
    @kareca18 2 года назад

    Really good job on this functions @Kris Kasprzak .
    Hope you don't mind me asking a question I havent seen answered before, how to clean the plot? I'm trying to get a moving graph (real temperatures for the last hour), and before redrawing the new set (every minute), I should clean the previous, but I don't see a easy way to do it.
    Thank you.
    Cheers, Luís Pereira.

    • @KrisKasprzak
      @KrisKasprzak  2 года назад

      I think you just reset redraw to true and plot again--it's been years since i used arduinos for this type of thing
      If you can switch to a Teensy, i have a much better library that allows multiple plot values and automatic redrawing.
      ruclips.net/video/vyvtpjQgRKQ/видео.html

  • @skullreaper20
    @skullreaper20 5 лет назад

    It will be able to display acceleration?

  • @jafinch78
    @jafinch78 4 года назад

    Thanks for sharing!

  • @bryanttaylor6048
    @bryanttaylor6048 3 года назад

    I have the Temperature graph running without being redrawn after a pass. The old data plot stays on the screen after each pass. How do I write over the old data. I read somewhere in the comments to pass ox, oy to the function so each cell can manage the previous point. Not sure how to do that.

  • @ogunsadebenjaminadeiyin2729
    @ogunsadebenjaminadeiyin2729 6 лет назад

    Thank you for sharing your code sir

  • @himhirit
    @himhirit 4 года назад +1

    Thank you very much.

  • @everything2063
    @everything2063 7 лет назад +2

    Really amazing

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад +1

      Thanks, post a project, we'd love to see your work.

  • @pm2172
    @pm2172 6 лет назад

    Great Video and Tutorial
    Just wondering how to get the temperature graph to run continuously rather than just for 60 data points. Bit of a novice I am afraid. Any help much appreciated
    P

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад +1

      depends on how you want to update the screen, 1) write a full screen, erase the update for the next pass or 2) have the screen "pan" with the drawn point being in the same spot. method #1 is easy, but would take some tweaks to the function.

  • @frazermann1448
    @frazermann1448 3 года назад

    Great vid :). I was wondering if you could suggest how to scroll the plots to the left. Ive managed to get the X-Axis to scroll to the left but i dont know how to shift the plotted data values by the same amount and delete the 1st segment of the line.

    • @user-lo1cl8de1s
      @user-lo1cl8de1s 3 года назад

      Use an array

    • @kareca18
      @kareca18 2 года назад

      Hi
      Did you manage a way? I'm guessing you have to remove the previous plot before plotting the shifted one.

  • @sasidharmuppala7196
    @sasidharmuppala7196 6 лет назад

    Hii Kris!! I have a small doubt.Can we plot a graph in tft with 2 variables like angle of servo (vs) values from ldr .What i mean is can we plot a graph by taking a varible other than time as reference in tft?

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад +1

      probably, the code would need some tweaking though. If your data increases and decreases you may have weird lines all over the graph, may draw dots or circles for each point. Not sure what effect you are looking for.

    • @sasidharmuppala7196
      @sasidharmuppala7196 6 лет назад +1

      Kris Kasprzak thanks for ur reply.My doubt is can we plot graph between 2 values .For example temperature sensor values vs pressure sensor values.is there any method to plot a graph in arduino that as the x value changes y values will change.

  • @BeInJavaUkraine
    @BeInJavaUkraine 4 года назад

    So much respect for your hard work!

    • @KrisKasprzak
      @KrisKasprzak  4 года назад +1

      Thanks for the feedback. I have since updated this graphing library to better implement. You can plot multiple values (up to 10) and the graph auto-redraws when x exceeds the x-axis scale. You will need to be using the ILI9341_t3 library (meaning using a Teensy and tft display).
      Here's the lib wtih examples github.com/KrisKasprzak/ILI9341_t3_controls

    • @BeInJavaUkraine
      @BeInJavaUkraine 4 года назад

      @@KrisKasprzak I will see, thanks again!

    • @BeInJavaUkraine
      @BeInJavaUkraine 4 года назад

      ​@@KrisKasprzak Wow, that is amazing, I wanted to do something similar, but i really appreciate that someone spent their time, doing so needful things. So I'll certainly use it, and may be do something else.

    • @KrisKasprzak
      @KrisKasprzak  4 года назад

      Spacibo!

  • @sidetrack1977
    @sidetrack1977 7 лет назад

    Nice looking code! I got a problem though. Im running the Adafruit_TFTLCD.h library (8 bit mode) on this screen. How do I convert it from SPI mode that you are running? Thanks for sharing!

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад

      Shouldn't matter the library call are the same.

  • @floridian080
    @floridian080 3 года назад

    Chris, Very informative tutorial. I wonder if you can explain how to plot analog sensor data saved on an SD card as txt or csv file on a TFT. That is, I would like to see the data on TFT just as it appeared when it was initially recorded from the sensor. Thanks,
    Mike

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      I may have some code laying around for that. Note I have a better graphing library (a real library) and a "print screen" library but are for a Teensy. I've actually abandoned arduino years ago due to low memory and slow processing.

  • @n0642116
    @n0642116 4 года назад

    Hi Kris, great code! If I use your line graph to plot sensor data, how do I get the graph to plot continuously (rather than stop after 1 pass). Thank you

    • @KrisKasprzak
      @KrisKasprzak  4 года назад

      What display driver are you using? I'm working on a lib that redraws and has capability for multiple grahps. However it for the Teensy ILI9341_t3 library.

    • @n0642116
      @n0642116 4 года назад

      @@KrisKasprzak Hi Kris, thanks for your response. Is there any chance to touch base in person to figure this out? Happy to send you my code. I am using the exact same libraries and display as you do. Thank you

  • @Isotope1213
    @Isotope1213 7 лет назад

    can you provide a wiring sketch?

  • @123boymonkey
    @123boymonkey 6 лет назад

    Awesome! So easy to use with neat graph.
    Is it possible to plot two lines of data on the same graph (say temp and dew point)? i have tried calling the function twice but it seems to shade the area between the two plotted lines... any ideas?
    Cheers Mitch

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад +1

      Yes, 1) the down and dirty, is to just copy the graph to a second function and call with with the same parameters. 2) the ultimate way wold be to pass ox, oy to the function so each call can manage the previous point
      ______________________________________________
      if you did #1 here's how
      // step 1 create a second instance
      void GraphAnother(Adafruit_HX8357 &d, double x, double y, double gx, double gy, double w, double h, double xlo, double xhi, double xinc, double ylo, double yhi, double yinc, String title, String xlabel, String ylabel, unsigned int gcolor, unsigned int acolor, unsigned int pcolor, unsigned int tcolor, unsigned int bcolor, boolean &redraw) {
      // step 2, in the global variables add
      boolean display1 = true;
      boolean displayanother1 = false; // need not paint the graph again
      double ox , oy , oxanother, oyanother, y, yanother;
      //step 3 call the functions
      for (x = 0; x

    • @123boymonkey
      @123boymonkey 6 лет назад

      Kris Kasprzak, you are a legend!!! Cheers my man!

  • @danblankenship5744
    @danblankenship5744 3 года назад

    I see you have several versions of display graphing and chart software. Can you suggest the best for my application?
    I am wanting to try to precisely control the temperature of a toaster oven over a short span of time. there are several stages I need to control to meet the heat profile to reflow solder correctly. I have developed a working model of software needed to control the temperature using many functions. All I want now is a display that can show the actual temperature reported by the thermal-couple in real-time. I have been testing some of the available libraries and all of the extra baggage eats up the very limited memory on my Uno.
    I want a chart that every two-seconds an interrupt can trigger a new plot and then jump back to the appropriate function without much delay.
    I was thinking that these cheap 128x64 OLED IIC displays would be the easiest option, but I could go for a slightly larger TFT LCD display.
    Can you steer me to your best option? Thanks

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      I have a suggestion but very different from what you are probably expecting. It sounds like your project will be used in some production environment. Do you want to log data to and SD card to see performance trends over say months, any desire to connect to blue tooth to monitor with a phone, touch screen support to eliminate mechanical buttons, have a printed PCB board for improving life and reliability? Any of this and graphing on and UNO will be tough. I've yet to find a graphing lib for an OLED that is not memory hungry, and while my libs will run on an UNO, you may not have much memory left for professional looking fonts--and doubt you can add SD support.
      I was in a similar situation and kept running out of ram and the form factor of an UNO was near useless. I tried the NANO for PCB mounting, but memory was always an issue--I spend weeks optimizing code to squeeze a few K just so the darn thing could run.
      I switched to a Teensy 3.2 a few years ago and have had a very good experience. They are much faster, have tons of RAM, and program easily with the Arduino IDE. They are compatible with Arduinos and library support is as good or better than Arduino. I have a much better graphing lib, slider lib, and button libs, but requires a display lib specific to a Teensy (the common ILI9341 displays).
      It sounds like a complete retool, but it's not that bad of a switch. Definitely worth moving as your capability cab be greatly expanded. I imagine your UI with neat graphs, set up menus, alarms. trend trackers, sliders to adjust temps, real time clocks (and with threading for real-time display). Simple for a Teensy--forget Arduino.

  • @Isotope1213
    @Isotope1213 7 лет назад

    i got the wiring through your code. thanks. how can you control the x from the screen? is there a button on the screen for x input? i did not see it in the video

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад

      I'm not sure what you are talking about. X is driven from the loop.

    • @Isotope1213
      @Isotope1213 7 лет назад

      what i mean is, is there anyway could there be an input box on the screen, where you can enter the value for x. I know its already in the code, but every time the user had to go the ino file to change the value of x. thanks

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад

      yes, this LCD has touch screen capabilities. The libraries come with a touch screen example.

  • @salvatorecristiano2030
    @salvatorecristiano2030 5 лет назад

    The video is wonderful, but how can i draw on the lcd JUST what is written on the arduino serial plotter?

    • @KrisKasprzak
      @KrisKasprzak  5 лет назад

      try Display.println(); will need to use setCursor(0,0) before your println statements

  • @kthornsberry
    @kthornsberry Год назад

    Very useful. I came across this video looking for a way to display graphs on a Waveshare epaper display. Would love to see you cover that.

    • @KrisKasprzak
      @KrisKasprzak  Год назад +1

      What are the screen refresh rates like? It’s my understanding Those things are very slow.

    • @kthornsberry
      @kthornsberry Год назад

      @@KrisKasprzak They are very slow, but perfectly sufficient for displaying, in my case, the last several hours of barometric pressure data, when I request it. I don’t know the specs off the top of my head. Waiting for my first one to arrive so I can begin my project.

  • @chatchaisirithipvanich1483
    @chatchaisirithipvanich1483 5 лет назад

    Thank you very much

  • @Calabogiepineside97
    @Calabogiepineside97 5 лет назад

    Hey Kris, Great code appreciate it!
    I am trying to graph temperature readings from two seperate thermocouples. Please help if you can. Also, is there a way to program continuous measurement, so that the graph clears itself every 10s or so?

    • @KrisKasprzak
      @KrisKasprzak  5 лет назад

      yes and yes, both are easy to implement. you could modify the function to accept 2 arguments for each temp measurement, then add some code to plot--code will be the same as current except for a change to Temp2.
      several ways to make continuous 1) clear screen when plot reaches the end. 2) when plot reaches the end pan the graph (this will take some work but not technically hard)

    • @Calabogiepineside97
      @Calabogiepineside97 5 лет назад

      @@KrisKasprzak Will it be a repeat of the code that starts with Graph (...........................) or will it need to be altered further at the bottom

    • @KrisKasprzak
      @KrisKasprzak  5 лет назад

      @@Calabogiepineside97 for plotting 2 variables (assuming they have the same scale.... 3 changes are needed 1) the call to Graph() 2) argumnet list in void Graph(...) 3) plotting code near the end of Graph() function

    • @Calabogiepineside97
      @Calabogiepineside97 5 лет назад

      @@KrisKasprzak Thanks Kris, I will give that a try. Really appreciate the fast replys, you are awesome and making my day!! Big love from Canada, friend.

    • @KrisKasprzak
      @KrisKasprzak  5 лет назад

      @@Calabogiepineside97 Visited Toronto over the summer--part of a college tour. We sooooo loved that city.

  • @singhlaprit2117
    @singhlaprit2117 2 года назад +1

    thanks for code you are really great and save lot of time and real nice guy thank you very much and keep it up and you doing great job love from india

  • @ElectroMentor
    @ElectroMentor 3 года назад +1

    Good work 👍

  • @gabrielaugusto5884
    @gabrielaugusto5884 4 года назад

    Your code use the SPI communication. Is it possible to use the 8-bit configuration? If the answer is yes, what should I do?

    • @KrisKasprzak
      @KrisKasprzak  4 года назад

      You can, Adafruit has a tutorial covering this--check out their website.

  • @arahamabeddin7442
    @arahamabeddin7442 2 года назад

    Sir could you please tell me which display you have used in this project?

  • @SatishKumar-yn8tr
    @SatishKumar-yn8tr Год назад

    I need plot Cartesian plot on tft display ili9341 2.8 inch using arduino uno. What library shall i use. Please help anyone. Urgent

  • @sergiomoranavarrete9426
    @sergiomoranavarrete9426 7 лет назад

    Thank you! It is possible to show in the screen the information about 3 different sensors?

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад +1

      It is and I tried this, but will take some hacking. i'll see if i have the code somewhere.

    • @sergiomoranavarrete9426
      @sergiomoranavarrete9426 7 лет назад

      I want to make an autamted irrigator system for plants that are already in old pots, with sensors for moisture, heat and sun light.

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад

      I think my code can be hacked to display those readings. Another option is to store the values in an array and display independently. Some touch screen button to plot this array or that array.

    • @sergiomoranavarrete9426
      @sergiomoranavarrete9426 7 лет назад

      Thank you for all of your answers! I have seen that the information can be stored in a memory, I think this project can help me with my flowers and for farmers with limit resources, I want to make a tutorial about this project not so hard to make.

  • @diederickb1806
    @diederickb1806 7 лет назад

    awesome thanks!, would be nice to have this in a libary even though its a single function cleans up my code XD

    • @KrisKasprzak
      @KrisKasprzak  7 лет назад +1

      actually you can. Move the function code to a .h file (maybe call it graphs.h) and add the keyword "inline" before the void (inline void Graph(.....)). Then include that .h file in your sketch (#include ) and your are ready to make the function call.

  • @pingchouchen6178
    @pingchouchen6178 Месяц назад

    Sorry to bother you, I would like to ask if the code in the video can be used for 2.4 inch ILI9341 320*240. If it could work what modification details should I pay attention to ? Looking forward to your reply T_T

    • @KrisKasprzak
      @KrisKasprzak  Месяц назад

      I have a library for Adafruit_ILI9341 displays. It has and example for and ESP32 but that same example can be used for other boards. Have a look
      github.com/KrisKasprzak/Adafruit_ILI9341_Controls/tree/main

  • @liyanarosni2806
    @liyanarosni2806 6 лет назад

    does the code work if I use 2.8 inch Inch TFT LCD Display Touch Screen Module

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      Yes it should i'm using the bar chart function on a 2.4" tft, just note you will need to adjust where the graphs are drawn due to a smaller size.

  • @carelvandermerwe9960
    @carelvandermerwe9960 6 лет назад

    Hi Chris
    The Graphs works perfectly on the Teensy 3.5 with the ILI9341_t3.h library.
    Can you help me graph vibrations of a spinning propeller as a Sine wave ?
    The rig is a MPU 6050 accelerometer with an optical pick-up. The location of each vibration is calculated by the Teensy that transmit it to an lcd display.
    The idea is to graph the Vibrations as small bar graphs on the y axis positive or negative and the corresponding position of the vibration on the x axis 0-360 degrees.
    The theory is that the data points of the vibration give you a rough Sine wave.
    Regards
    Carel

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      How do you want screen updates to happen? Overwrite the current or pan the screen (like and EKG machine in the medical field)?

    • @carelvandermerwe9960
      @carelvandermerwe9960 6 лет назад

      Hi Chris
      Not like an ECG.
      A bar chart that adds new information on each rotation.
      For example
      On the first rotation the vibrations will be picked up on say 1 G at 45 degrees , 2G at 100 degrees and negative 4 at 290 degrees.
      Second rotation will be 1.8 G at 90 degrees , 3.5 at 200 degrees and 0 at 270 degrees.
      Each rotation will fill up the graph.
      If you connect all the tops of the bars on the positive side and bottoms on the negative side of the graph, you should see a sine wave.
      The highest point will be the out of balance point.

  • @Dancopymus
    @Dancopymus 4 года назад

    Hello Kris!
    What would it look like in code for a 3.5 inch SPI Breakout ILI9488 display? Thank you

    • @KrisKasprzak
      @KrisKasprzak  4 года назад

      I think there will be not much code changes, but depends on the lib you use. If you use the lib from jaretburkett (which leverages the Adafruit_GFX libs) the only code change I can think if are the following
      1. use a different include (include the ILI9488 lib) to #include
      2. the object creation where you would use
      ILI9488 tft= ILI9488(TFT_CS, TFT_DC, TFT_RST);
      3. the tft.begin will be different (and per the ILI9488 lib) to tft.begin();
      4. change the data type in the function call (PS...I should never have passed the entire display object in...)
      void Graph(Adafruit_HX8357 &d.... to void Graph(ILI9488 &d,...
      Maybe some others, but this lib uses the Adafruit stuff so swapping should be possible with little code changes. Let me know how it goes

  • @gunrunner110
    @gunrunner110 2 года назад

    Hello,
    thank you alot for the video! But the code on your github does not match the one in the Video. Where do i find the code from the Video? I am trying to plot a value from an ADC.
    Tank you!

    • @gunrunner110
      @gunrunner110 2 года назад

      I think i found the Code under your other Video. But i get the error "'Graph' was not declared in this scope
      ". What am i doing wrong?
      I am trying to get a graph of my value for days and i am so frustrated right now... I hope you can help! :D

    • @KrisKasprzak
      @KrisKasprzak  2 года назад

      Ahhh silly me...I uploaded the wrong .ino. check the link again. I've added Graph.ino that is for cartesian style graphing.
      I have the other ino for bar charts and a dial gage.

  • @suhailsurajpal
    @suhailsurajpal 3 года назад

    Can the code be changed to allow it to work on a normal tft character display

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      what is a normal tft character display? if you mean the 20x4 LCD's, sure not.

  • @Azarias84
    @Azarias84 Год назад

    hello, thanks for the video. Can i use this code to plot a RS-232 signal from an external device?

    • @KrisKasprzak
      @KrisKasprzak  Год назад +1

      It sounds like you’re trying to use this thing for an oscilloscope. I doubt it would work. I think Trying to show live data would fill the screen up faster than I can refresh

    • @Azarias84
      @Azarias84 Год назад

      @@KrisKasprzak oh I see. Anyways this project looks very promising for other applications. Thank you for answer Kris.

  • @kanwaldeeppuri8761
    @kanwaldeeppuri8761 6 лет назад

    hi,
    i am using a tft display which uses a ILI9481 drivers with arduino uno and not able to make graph on it. It works fine with adafruit TFTLCD library but not with TFT_HX8357-master. plz help me.

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      What is the problem? White screen, code will not compile? Hard to help with no info. but first things first... your libs probably came with some examples, try to get those working first.

  • @visco8262
    @visco8262 3 года назад

    Hi Kris, would this code work for graphing viscosity in real time?

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      maybe, define real-time? update every second, update every millisecond?

    • @visco8262
      @visco8262 3 года назад

      @@KrisKasprzak Every second - I've changed my mind on it as I have found out that using the serial monitor would be more simple and taking the values to excel to plot. Would you know how to connect a circuit that would work with a mosfet, ACS721 sensor and a tracking sensor to measure rpm using an arduino ?

  • @sasidharmuppala7196
    @sasidharmuppala7196 6 лет назад

    this is awesome, will it work only on adafruit displays or will it work on other kind of displays too??

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      I'll answer it this way...Adafruit libraries are not written for Adafruit displays they are written for a certian chip. There are other libraries that leverage Adafruit libraries (ILI9341_t3 for Teensy MCU's for example). Controller chips are ILI9341, and HX8357, probably others. I use some Adafruit displays and several non--but all are based on the two chips I mention. When ever I buy a display I make sure the controller chip is supported by the libraries I use.
      I use these functions on 2.8" displays, 2.4" displays and others but use the ILI9341 chip--which is supported buy the Adafruit libs.

    • @sasidharmuppala7196
      @sasidharmuppala7196 6 лет назад

      thank u for the reply!!can i use this for a 128x64 lcd(tn/stn display type) by adding adafruit libraries or do i need anything extra for that?

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      if you are referring to an OLED display based on the SSD1306 chip, i have another video and free code for that.

    • @chuckmerja
      @chuckmerja 3 года назад

      thank you for this tut and answer. i bought a sainsmart TFT320QVT that appears to use SSD1289 chipset . Will this library work with it, perhaps?? www.sainsmart.com/products/3-2-tft-lcd-touch-screen-with-sd-slot

  • @kychemclass5850
    @kychemclass5850 Год назад +1

    Nice! Tq.

  • @TasosManolidis
    @TasosManolidis 3 года назад

    hi can we use this for the i;i9341 displays with arduino mega.i cant make it to do 1 graph

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      you should be able to.

    • @TasosManolidis
      @TasosManolidis 3 года назад

      @@KrisKasprzak thank you i did it.how can i start and stop the graph with one button is it possible?

  • @anishbhurke847
    @anishbhurke847 6 лет назад

    Can u draw B-H curve ? one x-value two y-values ?

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      The function can be modified to draw 2 curves

    • @anishbhurke847
      @anishbhurke847 5 лет назад

      the input is stream of X and Y co-ordinate values and not functions, can it plot the respective x,y points?

    • @KrisKasprzak
      @KrisKasprzak  5 лет назад

      not sure what you are asking, the function plots x-y values

  • @rojenvincentmedino7502
    @rojenvincentmedino7502 2 месяца назад

    Does it work in other display devices??

    • @KrisKasprzak
      @KrisKasprzak  2 месяца назад

      It can, but you will need to so some editing--basically change the display object types during object creation and for the argument in each function. Also whatever display driver you plan on using must support calls like fillRect, setTextColor, setTextSize and many more.

  • @meryammimouni4645
    @meryammimouni4645 6 лет назад

    can you give comment how to run in using card 4duino 24 please, thanks.

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      I've never used a 4duino 24, and the graphics looks like it has it's own libs (non Adafruit). YOu will need to change the display libs and initilization lines and change ALL lines of code that have anything to do with the display, for example in drawing a line:
      Display.drawLine (0, 0, 100, 200, BLUE);
      will have to get replaced with
      Display.gfx_Line(0,0,100,200,BLUE) ;
      that goes for writing text setting fonts, everything.
      The Picaso_Serial_4DLib seems pretty rich, but converting my code that is based on an Adafruit lib
      to the Picaso libs will take a lot of rewriting.

  • @alexandreleblanc3174
    @alexandreleblanc3174 2 месяца назад

    Hello, i got the grpah to work but when it reach the end it crash the ardunio, i cant figure out why, is there a way to contact you to have your help dubugging why the program crash after running for 10 second.

    • @KrisKasprzak
      @KrisKasprzak  2 месяца назад

      I recommend filing an issue on the GitHub repository with source code. I’ll take a look.

    • @alexandreleblanc3174
      @alexandreleblanc3174 Месяц назад

      I think the problem is my lack of knowledge with C programing and arduino, i was able to make the 0.96 in screen graphing function work with data from a particule sensor but i cant seems to get it to work with this code for the bigger 3.5 in screen. Is there a way to contact you directly to get some help to figure out what im not understanding.

  • @emilywhite8092
    @emilywhite8092 6 лет назад

    my display is only lighting up and showing a white screen, any suggestions?

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      I get this every once in a while, sometimes I need to unplug / plug my MCU in--basically cycling the input power

    • @luc480
      @luc480 6 лет назад

      Same here. Is there no other cause ?

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      Are you using and Arduino UNO or a NANO and a non Adafruit display? Depending on the display i too get white screens with my NANO's (but only with a non-Adafruit display). The Adafruit display seems to work fine. I'm guessing the cheaper versions don't have lever shifters and cant' take the 5 volt signals from Arduino. My Teensy's fire right up with any display.
      Here's what I did to get my cheap TFT's an a NANO working.
      1. Supply the tft with NANO's 3.3 volt power supply
      2. use a voltage divider (i used 1K and 1K) between SCK ,MISO, CS, and D/C and ground
      3. Connect MISO directly to pin 12
      4. Reset goes to Vcc (3.3 volts)
      5. LED goes to Vcc (3.3 volts)
      run the graphicstest sketch supplied by Adafruit first.
      Hopefully this helps.

  • @TheCyberGamerz
    @TheCyberGamerz 3 года назад

    How do you reset the graph once it hits 60s for the temp sensor graph

    • @KrisKasprzak
      @KrisKasprzak  3 года назад +1

      I have to take a look at the code it's been years since I looked at that thing. I have updated that graphing tool too much better more intelligent Library. It will require you move to a Teensy ruclips.net/video/vyvtpjQgRKQ/видео.html
      Projects like this got me off of Arduinos in the first place. I got tired of running out of ram when trying to do anything real.

    • @TheCyberGamerz
      @TheCyberGamerz 3 года назад

      @@KrisKasprzak oh thanks for that code, but it only works with 9341 identifier. Mine is a 9486, any idea on how to trouble shoot this? I can email u my code if it helps, and thanks again!

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      @@TheCyberGamerz Have you tried changing the identifier in the function call? if your lib leverages Adafruit_GFX, that should be the only code change (apart from object creation and initialization)

  • @behroozyazdani6023
    @behroozyazdani6023 3 года назад

    So thanks

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      Glad you enjoyed. I have since moved from arduinos and now use teensy's exclusively. I have written a new library to do the same type of graphing that uses the ili9341_t3 driver. The new library has multiple plot capability and automatic redraw of the graph. Check out my video for an idea of what it can do

  • @SatishKumar-yn8tr
    @SatishKumar-yn8tr Год назад

    Will it work with esp-32s

    • @KrisKasprzak
      @KrisKasprzak  Год назад

      Yes, if you are using the display driver Adafruit_HX8357. If you are using the display driver Adafruit_ILI9341, use this lib github.com/KrisKasprzak/Adafruit_ILI9341_Controls

  • @felixfox527
    @felixfox527 3 года назад

    Greetings. Anyone can share the code to build the graph continuously. Do I need an array for this or can I do without it? Help. I'm not good at programming.

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      See my other videos. I have a lib that draws continuously and multiple data. Currently the light works for the ili9341_t3 driver but you could change data types in the lib to get to work with other libraries

    • @felixfox527
      @felixfox527 3 года назад

      @@KrisKasprzak Does this library work with arduino?
      i tried - compilation error for arduino board.

    • @felixfox527
      @felixfox527 3 года назад

      I want to try to cut a function for graphs from this library. Although it is unlikely that I will succeed (

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      @@felixfox527 The library (from this vid ruclips.net/video/vyvtpjQgRKQ/видео.html) is for a Teensy with a display that has the ILI9341 driver. I'm not sure what display you have but if the library you are using supports the Adafuruit_GFX you may be able change the lib to work with your driver. In the .H and .CPP files you will need to replace ILI9341_t3 with your driver. This will take quite a bit of editing, and font redefinitions as well.
      That will be the easy part...
      However i'm not sure you will have enough memory (unless you are using a MEGA).
      I dumped Arduinos years ago as they don't have enough memory, power, etc. for my uses. I use Teensy 3.2 and never looked back.

    • @felixfox527
      @felixfox527 3 года назад

      @@KrisKasprzak Yes. I will use arduino mega (I just learned about the Teens), a display on ili9488 and the UTFT.h library - it supports many displays, including ili9341 and is compatible with Adafuruit_GFX.
      I tried to cut the plot (graph) function out of your library, but unfortunately my level is low.
      Maybe you could help if there is time and it doesn't bother you?

  • @gideonpaul9594
    @gideonpaul9594 6 лет назад

    very nice work. can you give comment how to run in using oled SSD1306 128x64 display, thanks.

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      It would take some changes but i don't think much. Fonts, font sizes and colors, will be some of the biggest changes. If you are using the Adafruit_SSD1306 library it uses the Adafruit_GFX (which this codes uses as well). You will need to add a Display.display(); call which will actually send the display data to the screen. I have some videos that show how to use the 0.96" OLED displays.

    • @gideonpaul9594
      @gideonpaul9594 6 лет назад

      Thanks a lot Kris.

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      Give me a few days and i'll work up some code--and post to RUclips. Iv'e been meaning to do this for a while anyway.

    • @gideonpaul9594
      @gideonpaul9594 6 лет назад

      This will be great, thanks.

    • @KrisKasprzak
      @KrisKasprzak  6 лет назад

      Have a try with these updated functions, I'll make a vid soon
      drive.google.com/open?id=1gRAaPlQSMQdmA5dxNj-AezIy-_eEXsZQ

  • @ninoremegio1818
    @ninoremegio1818 Год назад

    sir what is SD_CCS?

  • @thompascoe8463
    @thompascoe8463 3 года назад

    I hope to use this with a XY plot scatter graph with -500 to +500 in x and y.

    • @KrisKasprzak
      @KrisKasprzak  3 года назад +1

      post a pic when done, i'm sure my subs would like to see

    • @thompascoe8463
      @thompascoe8463 3 года назад

      @@KrisKasprzak can your function put the zero point in the middle of the screen?

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      @@thompascoe8463 not out of the box

    • @thompascoe8463
      @thompascoe8463 3 года назад

      @@KrisKasprzak hmm i wonder how I would go about it then. Id love to chat directly some time about my project.
      Tom_pascoe1135@hotmail.com

    • @KrisKasprzak
      @KrisKasprzak  3 года назад

      @@thompascoe8463 actually it may out of the box
      looks like in the giant arguement list
      xlo = lower bound of x axis
      xhi = upper bound of x asis
      xinc = division of x axis (distance not count)
      so just set
      xlow = -500.0; // or whatever
      xhi = 500.0; // or whatever
      xinc = 100.0 // or what ever
      void Graph(Adafruit_HX8357 &d, double x, double y, double gx, double gy, double w, double h, double xlo, double xhi, double xinc, double ylo, double yhi, double yinc, String title, String xlabel, String ylabel, unsigned int gcolor, unsigned int acolor, unsigned int pcolor, unsigned int tcolor, unsigned int bcolor, boolean &redraw) {
      then I thing you will just set x and y the call
      Graph(tft, x, y, bla bla bla

  • @ArthurLugon
    @ArthurLugon 6 лет назад

    Hi Mr. Kasprzak.
    great work, thks for sharing it...could u share ur email too? I'v some questions about how i can make multiple graphs at the same time for multiple sensors.

  • @mtalhakhalid1679
    @mtalhakhalid1679 2 года назад

    make oscilloscope with this as well

    • @KrisKasprzak
      @KrisKasprzak  2 года назад +1

      Not with these display drivers. Your would need some DMA capability. The Teensy has some libraries that offer DMA.

  • @certified-forklifter
    @certified-forklifter 5 лет назад +1

    FREE CODE!!!