In this Arduino Bitmap Graphics Tutorial we are going to learn how load bitmap graphics in our Arduino Touch Screen projects using Adafruit’s GFX library. We are going to use some of the most popular Arduino displays. Let’s get started!
Arduino Bitmap Graphics Tutorial – The Parts
Hey guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266 and other popular boards. In this video we are going to learn how to load bitmap graphics on these color displays. As you can see, I have some color displays here, and each one displays some custom bitmap graphics. Loading bitmap graphics is a very useful functionality that Adafruit’s GFX library offers. With this functionality we can make our Arduino or ESP8266 projects much more fun and interesting! Let’s see how to achieve this result.
The procedure that I am going to describe works with all the color displays that are supported by Adafruit’s GFX library and by the displays that use the TFTLCD library from Adafruit with a small modification. So from the displays I own I can use the color OLED display, the 1.8” ST7735 color TFT display, the 2.8” Color Touch Screen that I reviewed a few weeks ago and the 3.5” Color TFT display.
WHERE TO BUY
Color OLED: http://bit.ly/ColorOLED
1.44″ TFT: http://bit.ly/144TFTLCD
1.8″ TFT ST7735: http://educ8s.tv/part/7735
2.8″ Touch Screen: http://bit.ly/ArduinoTouch
3.5″ Color TFT: http://bit.ly/ColorTFT35
Arduino Uno: http://bit.ly/Cheap_Uno
Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!
Arduino Bitmap Graphics Tutorial – The Code
📥 Adafruit GFX Library: https://github.com/adafruit/Adafruit-GFX-Library
📥Image2Code Java Utility: https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code
The GFX library from Adafruit offers a function which is called drawBitmap which displays a monochrome bitmap image on the display. We can’t load multicolor graphics with this function just single color graphics. But we can change the color of the bitmap image so with a little imagination we can create colorful graphics. If the display we use does not support the Adafruit GFX library but it is using the TFTLCD library we have to copy the code of the drawBitmap function in our sketch before we can use it.
The drawBitmap function takes 6 arguments. The first two are the x and y coordinates of the screen where we want the image to be displayed. The next argument is the array in which the bitmap is loaded in our code. The next two arguments are the width and height of the bitmap in pixels, in other words the resolution of the image. The last argument is the color of the bitmap, we can use any color we like. The bitmap data must be located in program memory since Arduino has a limited amount of RAM memory available.
CODE OF THE PROJECT
SUBSCRIBE ON YOUTUBE
Never miss a video: Subscribe to educ8s.tv