wilmouths/RGBLed
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
RGBLed Arduino library
This library for Arduino allows you to control RGB led.
- Create an object, this object takes one parameter which corresponds to the analog pins are connected to on the Arduino.
- Set LED relative brightness level. (Note: brightness level defaults to 100 .)
- Set brightness and color at the same time ()
- Set step (0-255) for specific color gradient between two colors
You can create your own colors or use the followings colors
- RED
- GREEN
- BLUE
- MAGENTA
- CYAN
- YELLOW
- WHITE
Thank you to all our contributors!
About
An Arduino library to control RGB led
Resources
License
Stars
Watchers
Forks
Releases 7
Packages 0
Contributors 8
Languages
Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
32teeth/Color-Utilities-for-Arduino
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Color Utilities for Arduino
ColorUtils is a simple class for including in your c++ / avr or arduino projects
In your .ino file
In your setup() method of your .ino file
Example in your loop() method of your .ino file
About
color conversion utilities in c++ (for use with arduino ide)
Resources
Stars
Watchers
Forks
Releases
Packages 0
Languages
Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
moononournation/Arduino_GFX
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Arduino_GFX is a Arduino graphics library supporting various displays with various data bus interfaces.
This library start rewrite from Adafruit_GFX, LovyanGFX, TFT_eSPI, Ucglib, and more.
And Simple Usage
U8g2 Font Support
U8g2 proivided various font type and stored in compressed format. So U8g2 font gives more UI design possibilities and still can fit in the MCU limited storage space. Using U8g2 font in Arduino_GFX simply include U8g2lib.h before Arduino_GFX_Library.h:
And then setfont file to use:
U8g2 Unicode (UTF8) Font Support
Another U8g2 font advantage is the font support Unicode glyphs. Simply enable setUTF8Print:
And then print UTF8 string as usual:
Besides U8g2 generated font, Arduino_GFX also generated some useful font set from latest unifont_jp-14.0.02:
- Glyphs: 57389/57389
- Size: 2,250,360
- Generation script:
- Glyphs: 22145/57389
- Size: 979,557
- Generation script:
- Glyphs: 7199/57389
- Size: 298,564
- Traditional Chinese common font list: https://raw.githubusercontent.com/ButTaiwan/cjktables/master/taiwan/edu_standard_1.txt
- Simplified Chinese common font list: http://zht.glyphwiki.org/font/gw1197839.source
- extra font list: 32-127,11904-12351,63744-64255,65280-65376
- Generation script:
- Glyphs: 41364/57389
- Size: 1,704,862
- Generation script:
This library is not putting speed at the first priority, but still paid much effort to make the display look smooth.
Below are some figures compare with other 3 Arduino common display libraries.
- Arduino IDE: 1.8.15
- arduino-esp32: 1.0.6
- Dev Board: TTGO T8 v1.8
- PSRAM: disable
- Display: ILI9341
- Interface: SPI
- SPI Frequency: 40MHz
- Test time: 2021 Jun 16
Benchmark | Adafruit_GFX | Arduino_GFX | Lovyan_GFX | TFT_eSPI |
---|---|---|---|---|
Screen fill | 195,782 | 160,094 | 154,341 | 155,938 |
Text | 97,662 | 18,960 | 22,473 | 21,752 |
Pixels | 1,365,211 | 903,549 | 867,702 | 775,781 |
Lines | 1,062,311 | 412,026 | 269,060 | 264,950 |
Horiz/Vert Lines | 17,637 | 14,197 | 13,692 | 13,833 |
Rectangles-filled | 406,817 | 332,696 | 320,761 | 323,908 |
Rectangles | 11,641 | 9,254 | 8,545 | 8,714 |
Triangles-filled | 150,941 | 118,010 | 105,661 | 109,675 |
Triangles | 58,843 | 23,570 | 15,884 | 16,277 |
Circles-filled | 76,739 | 52,170 | 42,787 | 45,827 |
Circles | 118,125 | 40,955 | 25,959 | 25,269 |
Arcs-filled | N/A | 33,381 | 21,546 | N/A |
Arcs | N/A | 66,054 | 47,901 | N/A |
Rounded rects-fill | 408,534 | 338,136 | 318,882 | 323,189 |
Rounded rects | 43,185 | 21,562 | 13,089 | 15,371 |
- No read operation. Since not all display provide read back graphic memories API, Arduino_GFX skip all read operations. It can reduce the library size footprint and sometimes reduce the operation time.
- Tailor-made data bus classes. Arduino_GFX decouple data bus operation from display driver, it is more easy to write individual data bus class for each platform.
Various data bus interfaces
Arduino_GFX utilizes Arduino Built-in SPI class to support 8-bit SPI for most platforms.
Most tiny displays in hobbyist electronics world support 8-bit SPI, but some require 9-bit SPI. Arduino_GFX should be the first Arduino display library that can use ESP32 SPI to support 9-bit hardware SPI. It is important to support the displays that require 9-bit SPI interface. (e.g. HX8357B, . )
Larger displays most likely do not support standalone SPI since it is not fast enough to refresh the full screen details. Most of them support 8-bit/16-bit Parallel interface.
Some larger display require RGB + 3-bit SPI combo interface, This interface requies at most 3(9-bit SPI) + 4(CS, CD, WR, RD) + 24(RBG888) = 31 pins. Most dev board do not have enough GPIO to support this. Arduino_GFX is stick to RGB565 color, so RGB666 and RGB888 require some connection hack. E.g. RGB666 connect R5 and R6 together, B5 and B6 together to become RGB565. Then the least GPIO requirement can become 3(9-bit SPI) + 2(CD, WR) + 16(RBG565) = 21 pins. Remember always pull down CS pin and always pull up RD pin.
Currently Supported data bus [Wiki]
- 8-bit and 9-bit hardware SPI (ESP32SPI)
- 8-bit hardware SPI (HWSPI, ESP8266SPI, mbedSPI, NRFXSPI, RPiPicoSPI)
- 8-bit and 9-bit software SPI (SWSPI)
- 8-bit parallel interface (SWPAR8, AVRPAR8, ESP32PAR8, ESP32S2PAR8, RPiPicoPAR8, RTLPAR8, STM32PAR8)
- 16-bit parallel interface (ESP32LCD16, ESP32PAR16, ESP32S2PAR16, RPiPicoPAR16)
- RGB565+SPI interface (ESP32RGBPanel)
Tobe Support data bus (Sponsors can make it happen)
- Arduino ATMega2560 dual 8-bit Port form 16-bit parallel interface
- FastLED
Currently Supported Dev Board
- Ameba RTL8722DM Board (AMB 21)
- Ameba RTL8722DM MINI Board (AMB 23)
- Arduino Nano
- Arduino Nano BLE 33
- Arduino Pro Micro
- ESP8266 Series
- ESP32 Series
- ESP32-C3 Series
- ESP32-S2 Series
- ESP32-S3 Series
- Raspberry Pi Pico
- Raspberry Pi Pico W
- rtlduino BW16 (by Ai-Thinker)
- Sony Spresense
- WeAct BlackPill V2.0 (BlackPill F411CE)
Tobe Support Dev Board (Sponsors can make it happen)
Currently Supported Dev Device [Wiki]
- ESP32 LCDKIT
- ESP32-S3-EYE
- ESP32-S3-Box
- ESPboy [demo video]
- M5Stack Core Family
- Makerfabs ESP32 3.5″ TFT Touch with Camera
- Odroid Go
- TTGO T-DISPLAY
- TTGO T-DISPLAY-S3 [demo video]
- TTGO T-QT
- TTGO T-Watch
- wireless-tag WT-32-SC01
- Wio Terminal
Currently Supported Display [Wiki]
- GC9A01 round display 240×240 [demo video]
- GC9106 80×160 [demo video]
- GC9107 128×128 [demo video]
- GC9503V (RGB) 480×480 [demo video]
- HX8347C 240×320 [demo video]
- HX8347D 240×320 [demo video]
- HX8352C 240×400 [demo video]
- HX8357A 320×480 [demo video] (currently only portrait works, i.e. rotation 0 and 2)
- HX8357B (9-bit SPI) 320×480 [demo video]
- ILI6485 (RGB) 480×272 [demo video]
- ILI9225 176×220 [demo video]
- ILI9341 240×320 [demo video]
- ILI9341 (8-bit Parallel) 240×320 [demo video]
- ILI9342 320×240 [demo video]
- ILI9481 320×480 (18 bit color) [demo video]
- ILI9486 320×480 (18 bit color) [demo video]
- ILI9488 320×480 (3 bit color with canvas) [demo video]
- ILI9488 320×480 (18 bit color) [demo video]
- ILI9806 (8-bit/16-bit Parallel) 480×854 [demo video]
- JBT6K71 (8-bit Parallel) 240×320 [demo video]
- NT35310 320×480 [demo video]
- NT35510 (8-bit/16-bit Parallel) 480×800 [demo video]
- NT39125 (8-bit/16-bit Parallel) 240×376 [demo video]
- R61529 (8-bit/16-bit Parallel) 320×480 [demo video]
- Raspberry Pi DPI Display (RPi_DPI_RGBPanel) Any Resolution [demo video]
- SEPS525 160×128 [demo video]
- SSD1283A 130×130 [demo video]
- SSD1331 96×64 [demo video]
- SSD1351 128×128 [demo video]
- SSD1351 128×96
- ST7262 800×480 [demo video]
- ST7735 128×160 (various tabs) [demo video]
- ST7735 128×128 (various tabs) [demo video]
- ST7735 80×160 [demo video]
- ST7701 (RGB) 480×480 [demo video]
- ST7789 TTGO T-Display 135×240 [demo video]
- ST7789 240×240 [demo video]
- ST7789 TTGO T-Watch 240×240 [demo video]
- ST7789 round corner display 240×280 [demo video]
- ST7789 240×320 [demo video]
- ST7796 320×480 [demo video]
Tobe Support Display (Sponsors can make it happen)
- FastLED Martix supported by co-operate with Canvas
- Mono display supported by co-operate with Canvas
- Multi-color e-ink display supported by co-operate with Canvas
- Canvas (16-bit pixel)
- Canvas_Indexed (half memory space)
- Canvas_3bit (1/4 memory space framebuffer)
- Canvas_Mono (1/16 memory space framebuffer)
3 LVGL demo provide in examples folder:
Feature wishlist (Sponsors can make it happen)
- Print color Emoji Characters
- Load bitmap font files from flash / SD
- Fill Gradient
Using source code come from:
About
Arduino GFX developing for various color displays and various data bus interfaces
Arduino_GFX
Introduction: Arduino_GFX
This instructables introduce a color display graphic function (GFX) Library for Arduino.
The content is intended to be updated from time to time, I will add more details if Arduino_GFX added more features. You can also help me enrich the content by leaving comments below.
Step 1: What Is Arduino_GFX?
Arduino_GFX is a color display GFX library for Arduino.
«for Arduino» means aims to support as much Arduino Platform as possible. And also aims to support as much display as possible in various interfaces.
Most hobbyist electronics market color display is SPI and most Arduino Platform support SPI. Arduino_GFX utilize Arduino native SPI class as basic interface, HWSPI, so Arduino_GFX is already virtually ready for most platform and most display.
Step 2: Software Design
Arduino_GFX start rewrite from Adafruit_GFX and used many features from LovyanGFX and TFT_eSPI, but the high level design is a little bit like Ucglib. Arduino_GFX decouple display driver and data interface into 2 separate class. It gives much more flexibilities, for example, ILI9341 display can use:
- 8-bit SPI
- 9-bit SPI
- 6-bit parallel
- 8-bit parallel
- 9-bit parallel
- 16-bit parallel
- 18-bit parallel
Arduino_GFX support four of them:
- 8-bit SPI
- 9-bit SPI
- 8-bit parallel
- 16-bit parallel
Simply feed different data bus class to «Arduino_ILI9341» display class can support various type of ILI9341 display breakout module.
Step 3: Library Installation
- Open Library Manager in Arduino IDE: Tools menu -> Manage Libraries.
- Search «color display gfx» or «GFX Library for Arduino»
- select «GFX Library for Arduino» and Install
Or you can download the latest code from GitHub and import to library folder yourself:
Step 4: Ease of Use
Simple Declaration
The declaration only requires 3 lines, using create_default_Arduino_DataBus() or create_default_Arduino_GFX() still can make it simpler. This 2 functions will mention in later steps.
And Simple Usage
Step 5: Ease of Switching Hardware
Arduino_GFX write as generic as possible to support multi-platform. Switching dev board no need to change any code related to GFX function. Switching display simply replacing the GFX class, e.g. switching ILI9341 display to ST7789 IPS display will be:
Step 6: Manual Set Frequency
Every platform defined the default SPI speed, ESP family is 40 MHz, AVR family is 4 MHz, . etc. When you initial the gfx class, «gfx->begin();», you can pass the frequency value in it to override the default value:
Step 7: LED Backlight
As you can see the the declaration in previous step, there are no need to pass the LED pin to both class. This is because the LED on or off is not controlled by the display driver, in most case it is direct controlled by the MCU GPIO. Sometimes it is controlled by a dedicated power control chips; Sometimes there is no LED backlight, e.g. OLED.
So Arduino_GFX leave LED backlight control to the main program.
The most lazy way is just connect the LED pin to Vcc, but it may take a risk of burn out LED if the breakout board not have enough protection. So it is better using a GPIO:
Or if you want brightness control with PWM:
Please note ESP32 not implemented analogWrite(), it have its own LED control function:
Step 8: Benchmark
Arduino_GFX is not putting speed at the first priority, but still paid much effort to make the display look smooth. Let’s compare the speed with a most well known GFX library and 2 fastest GFX libraries.
Step 9: Why Run «Fast»?
Arduino_GFX write as generic as possible to support multi-platform; And use OO parent class to standardize various data bus class and display class API. These design have a little bit overhead.
Even it makes Arduino_GFX cannot run as fast as fine tuned Lovyan_GFX or TFT_eSPI, the figures is «very near» :P
Here is some design to make Arduino_GFX run fast:
- Tailor-made data bus classes. Arduino_GFX decouple data bus operation from display driver, it is more easy to write individual data bus class for each platform. E.g. NRFXSPI data bus class can run much faster than general HWSPI data bus class in Arduino Nano 33 BLE platform.
- Stick to 16-bit color space. 24-bit color is overkilled for most MCU and also most color display support 16-bit color (except ILI948* in SPI mode). Stick to 16-bit color only can simplify the implementation, run faster and reduce library size footprint.
No read operation. Since not all display provide read back graphic memories API, Arduino_GFX skip read operations at all. It can reduce the library size footprint and sometimes reduce the operation time.
Step 10: Size Does Matter?
Yes, if you are using the MCU with limited program space, e.g. Arduino Nano only have 32 KB program space (exclude the size of boot loader, maximum is 30720 bytes).
In early development stage, once I added the Arcs function to PDQgraphicstest example, I found it cannot fit in Arduino Nano. A display library used up all program space means you cannot do any thing in the project. It is not acceptable, so I raise an issue in GitHub myself:
After various fine tuning and tradeoff, now PDQgraphicstest use 28530 bytes (92%); And HelloWorld example use 11496 bytes (37%), I thing it is good enough for many projects.
Step 11: 2 Hardware Factors
When you design your display project, there are 2 variable hardware factors to consider:
- Dev board. Different dev board (platform) have different GPIO pins mapping and different interface (data bus) can be used. Also driving higher resolution color display smooth requires higher processing power.
- Display breakout board. Different Display have different display driver and different interface (data bus) can be used.
First of all, it must have common interface between the dev board and display, most likely it should be 8-bit SPI. And then you need to allocate other GPIO control pins, e.g. CS, DC, RST and LED. If you do not have preference for using which GPIOs, Arduino_GFX already defined some default for ease of use.
Since most display using 8-bit SPI, simply use below line to create the default 8-bit SPI data bus class:
Below steps illustrate the pins connection with the ILI9341 SPI breakout board for each platform.
Step 12: Teensy 4.1
Step 13: Arduino Nano
Since Arduino Nano is 5V dev board but most display is not 5V I/O tolerant so it require some resistors between GPIOs and display pins.
Step 14: Arduino Nano 33 BLE
Step 15: Black Pill
Step 16: ESP8266
Step 17: Seeeduino XIAO
Step 18: RTL8720DN
Step 19: ESP32
Step 20: ESP32-C3
Step 21: Raspberry Pi Pico
Step 22: Raspberry Pi Pico W
Step 23: Data Bus
Arduino_GFX now support the following data bus:
- 8-bit and 9-bit hardware SPI (ESP32SPI)
- 8-bit hardware SPI (HWSPI, ESP8266SPI, mbedSPI, NRFXSPI, RPiPicoSPI)
- 8-bit and 9-bit software SPI (SWSPI)
- 8-bit parallel interface (AVRPAR8, ESP32PAR8, RPiPicoPAR8, RTLPAR8)
- 16-bit parallel interface (ESP32PAR16, RPiPicoPAR16)
I cannot mention all data bus class detail here, just highlight some special below.
9-bit SPI
9-bit SPI is not the most common name for this interface, a more common name is 3-line SPI or 3-wire SPI. But I found there have 2 different meaning for 3-line SPI:
- No DC pin, append 1-bit for each 8-bit data to represent it is command or data. 3-line is CLK, MOSI and MISO
- Combined MOSI and MISO pin, data input and output use same GPIO. 3-line is DC, CLK and MOSI+MISO
So I will avoid call 9-bit SPI as 3-line SPI.
In digital world, the smallest data size is bit, but the actual smallest data computation and storage size is byte (8 bit). So many MCU only can support transfer SPI data bit in the factor 8. I found ESP32 SPI can freely control the number of bit transfer, so I make ESP32SPI Data Bus class support 9-bit SPI.
Software SPI also can support 9-bit SPI, it just slower.
mbedSPI or NRFXSPI
The official SPI for Arduino Nano 33 BLE is a little bit slow for color display, it even much slower than Arduino Nano. It is a well known issue on the web, the reason may caused by a mbedOS in the middle. When I dig into the firmware source code, I found 9 internal classes related to SPI. I selected implement 2 classes. I think NRFXSPI implementation can meet the performance of 64 MHz main frequency, mbedSPI is just a backup plan in case NRFXSPI broken something in mbedOS.
Parallel Interface
AVR family is 8-bit MCU, running in 8 or 16 MHz, maximum SPI speed is 4 MHz. Seems not fast enough for color display, as show in the first video. How about 8-bit parallel? MCU can use port operation command direct access all GPIOs under same port in 1 instruction. So AVR 8-bit parallel interface (AVRPAR8) can run much faster than SPI. However, most AVR dev board not breakout enough pins for 8-bit port operation. E.g. Arduino UNO only break out port D all 8 GPIOs but use port D require sacrifice the serial port pins.
Many 32-bit MCU also have port operation, but the port also in 32-bit. It means require some bit operation before setting only 8-bit data (more than 1 instruction), so it is not as efficient as 8-bit MCU.
RPiPicoPAR16 data bus class utilize Raspberry Pi Pico 32-bit data port first 16 bits to form a 16-bit parallel interface, average only requires around 2 instructions to send 16 bits data, so it is very efficient.
ESP32PAR8, RTLPAR8 and ESP32PAR16 are actually a semi-software implementation of parallel interface, so it is not run very fast.
Step 24: AVR Port Patching
As mentioned in previous step, many AVR breakout board not breakout all port GPIOs and limited the port parallel interface usage. If you want challenge your soldering skill, you can breakout the missing pins yourself ;>
The above pictures and video are breakout Arduino Pro Micro 8MHz port B all pins and connect to NT35310 display.
Step 25: Display Driver
Arduino_GFX currently support below display:
- GC9A01 round display 240×240
- HX8347C 240×320
- HX8347D 240×320
- HX8352C 240×400
- HX8357A 320×480 (currently only portrait works, i.e. rotation 0 and 2)
- HX8357B (9-bit SPI) 320×480
- ILI9225 176×220
- ILI9341 240×320
- ILI9342 320×240
- ILI9481 320×480
- ILI9486 320×480
- ILI9488 320×480
- JBT6K71 240×320
- NT35310 320×480
- NT35510 480×800
- NT39125 240×376
- R61529 320×480
- SEPS525 160×128
- SSD1283A 130×130
- SSD1331 96×64
- SSD1351 128×128 and 128×96
- ST7735 80×160, 128×128 and 128×160 various tabs
- ST7789 135×240, 240×240, round corner display 240×280 and 240×320
- ST7796 320×480
All display class details are described at GitHub Wiki: https://github.com/moononournation/Arduino_GFX/wi.
You may find more display discussion in my previous instructables: https://www.instructables.com/Select-Color-Displa.
I cannot mention all display details here, just highlight some special below.
GC9A01
This is a round display with 240×240 resolution. Same as ILI9341, this display is not 5V I/O tolerant so it require some resistors between GPIOs and display pins if using 5V MCU like Arduino Nano.
HX8357B
This is an IPS display with 320×480 resolution. This display only support 9-bit SPI so it is better connect with ESP32SPI.
NT35510
This is the highest resolution display I have in hand, it is 480×800. This display support 8-bit or 16-bit parallel interface.
Step 26: Canvas
Arduino_GFX provide various canvas class, sometimes it call framebuffer, for draw buffering on complicated presentation:
- Canvas (16-bit color, 2 bytes for each pixel)
- Canvas_Indexed (half memory space)
- Canvas_3bit (1/4 memory space framebuffer)
- Canvas_Mono (1/16 memory space framebuffer)
The display only require refresh once after canvas draw finish and call flush(). It can reduce the display flicking substantially but requires more RAM.
First declare a canvas output display:
Then declare canvas: (240×320 resolution requires 153600 bytes RAM)
Step 27: TFT 3-bit Driver
Some display support 3-bit color space like ILI9488. It is hard to direct implement 3-bit color space efficiently. But it can work with a Canvas_3bit class in the middle:
Step 28: Supported Dev Device
Arduino_GFX support create default display class accordingly to selected built-in display dev device in Board selection menu. Below are recognizable dev device:
- Wio Terminal
- M5Stack Core Family (v1)
- Odroid Go
- TTGO T-Watch
Step 29: More Dev Device
You may find PDQgraphicstest have more dev device setting example.
Step 30: Examples
Arduino_GFX have few examples demonstrate how to use this library:
(Arduino IDE File menu -> Examples -> GFX Library for Arduino)
- AsciiTable — show all default font characters in table format
- Clock — A simple non-flicking analog clock implementation
- Hello World — Everyone first display program
- HelloWorldGfxfont — more fonts
- ImgViewer — display Animated GIF, BMP, JPEG, MJPEG or PNG image files from flash file system or SD card
- LVGL — Demostrate the LVGL implementation with Arduino_GFX
- MultipleDeviceTest — connect multiple display at the same time
- PDQgraphicsTest — you can find many GFX functions demo here
- WiFiAnalyzer — A simple WiFi Analyzer for WiFi capable platform
- WiFiPhotoFrame — Download photo on the web and display on the fly
Step 31: More Application
Here are my previous instructables using Arduino_GFX:
1 Person Made This Project!
Did you make this project? Share it with us!
Recommendations
Halloween Contest
Cheese Challenge
Back to School: Student Design Challenge
57 Comments
Question 12 days ago
exit status 1
Compilation error: expected type-specifier before ‘Arduino_Canvas_3bit’
2) Is it misspelling on this page in canvas paragraph:
========
#include
// 3-bit color Canvas, R1G1B1, 8 colors
Arduino_G *output_display = new Arduino_ILI9488_3bit(bus, -1 /* RST */, 0 /* rotation */, false /* IPS */);
Arduino_GFX *gfx = new Arduino_Canvas_3bit(480 /* width */, 320 /* height */, output_display);
========
shouln’t be:
========
Arduino_GFX *output_display = new Arduino_ILI9488_18bit(bus, -1 /* RST */, 0 /* rotation */, false /* IPS */);
========
?
Answer 10 days ago
Sorry, Arduino did not have enough memory to support canvas. Please consider other platform with more memory.
Question 2 months ago
Hi very impressed with the speed of your graphics output
I have been trying to run your examples with my hardware and I am getting 2 errors that look to be issues between definition and constructors I am only a novice at coding and have so far not found where the problem is any help would be appreciated. I am using a pi pico and 2″ waveshare display hat 320 x 240
#include
#define TFT_BL 13
Arduino_DataBus *bus = new Arduino_RPiPicoSPI(8 /* DC */, 9 /* CS */, 10 /* SCK */, 11 /* MOSI */, UINT8_MAX /* MISO */, spi1 /* spi */);
Arduino_GFX *gfx = new Arduino_ST7789(bus, 12 /* RST */, 3 /* rotation */, true /* IPS */, 320, 240, 0, 80);
thats my mods to header in «hello world» example
In file included from C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/Arduino_GFX_Library.h:25:0,
from C:\Users\mlw56\Documents\libraries\GFX_Library_for_Arduino\examples\HelloWorld\HelloWorld.ino:21:
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:93: error: ‘PIN_SPI0_SCK‘ was not declared in this scope
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:93: note: suggested alternative: ‘PIN_SPI_SCK’
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
PIN_SPI_SCK
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:121: error: ‘PIN_SPI0_MOSI’ was not declared in this scope
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:121: note: suggested alternative: ‘PIN_SPI_MOSI’
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
PIN_SPI_MOSI
In file included from C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/Arduino_GFX_Library.h:25:0,
from C:\Users\mlw56\Documents\libraries\GFX_Library_for_Arduino\examples\HelloWorld\HelloWorld.ino:21:
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:150: error: ‘PIN_SPI0_MISO‘ was not declared in this scope
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
C:\Users\mlw56\OneDrive\Documents\Arduino\sketch_feb20a\libraries\GFX_Library_for_Arduino\src/databus/Arduino_RPiPicoSPI.h:16:150: note: suggested alternative: ‘PIN_SPI_MISO’
Arduino_RPiPicoSPI(int8_t dc = GFX_NOT_DEFINED, int8_t cs = GFX_NOT_DEFINED, int8_t sck = PIN_SPI0_SCK, int8_t mosi = PIN_SPI0_MOSI, int8_t miso = PIN_SPI0_MISO, spi_inst_t *spi = spi0); // Constructor
^
thats the error message from the arduino compiler
Regards