PchButik.se

kopplat

HOME
Displayer
LCD 800x480
parallell
ÅÄÖ

















7 tum LCD skärm. 800x480 pixel


Font med svenska tecken ÅÄÖ åäö

Flytta font filen till src-mappen.
Filen finns TFT_eSPI/examples/Generic/Local_Custom_Fonts/

Skärmen är kopplad med parallell inteface, se parallell.

Kod för att visa ÅÄÖ i filen main.cpp.

#include <Arduino.h>

#include "SPI.h"
#include "TFT_eSPI.h"

// The custom font file attached to this sketch must be included
#include "MyFont.h"

// Easily remembered name for the font
#define MYFONT32 &myFont32pt8b

// Use hardware SPI
TFT_eSPI tft = TFT_eSPI();
uint16_t pchOrange = tft.color565(220,40,0);//Denna är orange vid RGB)

void setup(void) {
  tft.begin();

  tft.setRotation(1);
  tft.setFreeFont(MYFONT32); 

  tft.setTextSize(1);

  tft.setCursor(0,50);
  tft.fillScreen(TFT_GREEN);
  tft.fillRect(0,0,tft.width(),65,TFT_BLACK);
  tft.setTextColor(pchOrange, TFT_BLACK);
  tft.println("PchButik.se");

  tft.fillRect(0,66,tft.width(),137, TFT_GREEN);
  tft.setTextColor(TFT_BLACK, TFT_GREEN);
  tft.setCursor(0, 130);
  tft.print("**-åäöÅÄÖ-**");

  tft.setCursor(0, 185);
  tft.setTextColor(TFT_BLUE, TFT_GREEN);
  tft.print("7 tum fullfärg TFT LCD");

  tft.setCursor(0, 240);
  tft.setTextColor(TFT_RED, TFT_GREEN);
  tft.print("800x480 pixel, 133 dpi");

  tft.setCursor(0,305);
  tft.setTextColor(TFT_DARKCYAN, TFT_GREEN);
  tft.print("Driver SSD1963");

  tft.fillRect(0,330,tft.width(), 44, tft.color565(31,31,31)); //mörk grå
  tft.fillRect(0,332,20, 20, tft.color565(255,0,0));
  tft.fillRect(20,352,20, 20, tft.color565(0,255,0));
  tft.fillRect(40,332,20, 20, tft.color565(0,0,255));
  tft.fillRect(60,352,20, 20, tft.color565(255,255,0));
  tft.fillRect(80,332,20, 20, tft.color565(0,255,255));
  tft.fillRect(100,352,20, 20, tft.color565(255,0,255));
  tft.fillRect(120,332,20, 20, tft.color565(0,0,0));
  tft.fillRect(140,352,20, 20, tft.color565(255,255,255));
}

void loop() {}