User Tools

Site Tools


arduino:displays_for_classic_arduinos:1.8_and_1.44_tft_displays_and_classic_arduinos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
arduino:displays_for_classic_arduinos:1.8_and_1.44_tft_displays_and_classic_arduinos [2018/01/28 01:50] – [Ucglib] mithatarduino:displays_for_classic_arduinos:1.8_and_1.44_tft_displays_and_classic_arduinos [2018/01/28 01:54] – [Arduino TFT library] mithat
Line 39: Line 39:
  
 [[display_st7735_1.44_ucglib_transparent.ino | source code]] [[display_st7735_1.44_ucglib_transparent.ino | source code]]
- 
  
 ==== Arduino TFT library==== ==== Arduino TFT library====
Line 49: Line 48:
 {{youtube>P_bLs5rMH5c?560x315&rel=0}} {{youtube>P_bLs5rMH5c?560x315&rel=0}}
  
-<file c++ display_st7735_1.44_TFT.ino+[[display_st7735_1.44_TFT.ino | source code]]
-/* +
- * display_st7735_1.44_TFT.ino +
-   +
- * Test screen update speed with large solid fonts on  +
- * a 128x128 TFT screen that uses the ST7735 chip. +
-   +
- * Consumes 26% of program storage space and +
- * 5% of dynamic memory on a Pro Mini. +
- *  +
- * Mithat Konar +
- */ +
- +
-#include <TFT.h>  // Arduino LCD library +
-#include <SPI.h> +
- +
-/* +
- * Pin assignments: +
- * RST: 8 +
- * CE/CS/SCE: 10 +
- * DC/"D/C"/A0:+
- * DIN/DN/MOSI/DATA: 11 (Arduino HW standard) +
- * CLK/SCLK/SCK: 13  (Arduino HW standard) +
- * VCC: 3.3V +
- * LIGHT/LED: ground through 1 ohm resistor (yields about 20mA) +
- * GND: ground +
- */ +
- +
-const unsigned int CLOCK_PIN = 13, +
-                   DATA_PIN = 11, +
-                   CS_PIN = 10, +
-                   DC_PIN = 9, +
-                   RESET_PIN = 8; +
- +
-const unsigned int LEFT_MARGIN = 32; // number of pixels you need to shift for 128x128 screen +
- +
- +
-TFT TFTscreen = TFT(CS_PIN, DC_PIN, RESET_PIN); +
-char dispStr[4];    // null terminated char array used to pass to TFT.text() +
-unsigned int counter = 80; +
- +
-void setup() { +
-  TFTscreen.begin(); +
-  TFTscreen.background(0, 0, 0);    // clear the screen +
- +
-  TFTscreen.stroke(255, 255, 255);  // set font color +
-  TFTscreen.setTextSize(1);         // set font size +
-  TFTscreen.text("TFT library", LEFT_MARGIN, 0); +
-   +
-  TFTscreen.setTextSize(7); +
-+
- +
-void loop() { +
-  // draw over what you wrote last time +
-  TFTscreen.stroke(0, 0, 0);    // background color +
-  String(counter).toCharArray(dispStr, 4); +
-  TFTscreen.text(dispStr, LEFT_MARGIN, 40);   +
- +
-  // update and draw something new +
-  counter++; +
- +
-  TFTscreen.stroke(255, 255, 255);  // font color +
-  String(counter).toCharArray(dispStr, 4); +
-  TFTscreen.text(dispStr, LEFT_MARGIN, 40); +
- +
-  // inherent frame rate of this loop is about 15 fps w/o added delay (8 MHz processor). +
-  delay(500); +
-}+
  
-</file> 
  
 ==== Adafruit ST7735 Library ==== ==== Adafruit ST7735 Library ====
arduino/displays_for_classic_arduinos/1.8_and_1.44_tft_displays_and_classic_arduinos.txt · Last modified: 2018/01/31 04:55 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki