Arduino LCD Shield. Quelle:

Ähnliche Dokumente
Bisher hatten immer nur als Ausgänge geschaltet und hierfür folgende Befehle benutzt:

Arduino für FunkAmateure

analoge Ein- und Ausgänge

HelvePic32 Breadboard. Internet Data Logger

LCD-Display 16x2 QAPASS (AllNet)

Starten Sie die Arduino IDE und geben Sie den folgenden Programmcode ein:

ERWEITERUNGSSHIELD MIT ANALOGEN EINGÄNGEN

~10 RESET 3.3V 5V GND GND VIN

Arduino für FunkAmateure

Einführung in Mikrokontroller Benutzung mit dem Arduino Board. Ramon Hofer ICVR

Erste Gehversuche mit ARDUINO (DL6OAA)

Arduino - Einfacher Teiler

Tube Analyzer LogViewer 2.3

STM32 - Schieberegister, SPI - u

Arduino. Inhalt. (mit Arduino UNO)

// Daniel Ettenhuber // Projekt Kameraslider // letzte Änderung: // //

Was so passieren wird:

Fachprojekt for Embedded System: Design and Implement Your Own Embedded Systems (2) LS 12, TU Dortmund

Bedienungsanleitung / Manual für il-debug_i Interface für den Debugger il_debug

LCD Modul 84x84 Nokia 5110

Ansteuerung eines LCD-Screens

Willkommen!

Arduino Kurs Das LC-Display. Stephan Laage-Witt FES Lörrach

MSP-EXP430G2. LaunchPad Entwicklungskit MSP-EXP430G2. Schnellstart mit dem Texas Instruments. LaunchPad Entwicklungskit

!!!Hier bezogen auf den ucontroller AT89C5131!!!

Haftkünstler auf dem Prüfstand. Online Ergänzung HOLGER FLORIAN BOHN OLGA SPECK THOMAS SPECK

LCD Display 20x4 mit Buttons

Anschluss Flachbandkabel

Serielle Kommunikation mit dem Arduino. Teil 1: Das Serial Peripheral Interface (SPI)

Einführung DIP & AVR EVK1100

Bus Manuals SPI I2C. Busse und Sensoren. Twix. Chaos Computer Club Cologne Twix

Arbeitsblatt Nr.19: RFID Kit

Eine tastergesteuerte LED

Anwendung und Programmierung von Mikrocontrollern. Anwendung und Programmierung von Mikrocontrollern

Erste Schritte. Programmieren für Ingenieure Sommer Andreas Zeller, Universität des Saarlandes

Umbau eines Saug- und Wisch Roboters auf ARDUINO Steuerung

Arduino für FunkAmateure

Milliwattmeter mit Arduino Uno (low-cost-version)

Chrosziel GmbH Klausnerring Kirchheim b. München Germany Tel , Fax

miditech 4merge 4-fach MIDI Merger mit :

Jan Monsch. Donnerstag, 2. Mai 13

saarland Prof. Dr. Andreas Zeller Verantw. Tutor: Florian Groß Übungsblatt 4

ADAM35-LCN-QV-EDT. Datenblatt

Arduino µcontroller. Virtuelle COMSchnittstelle

Arduino und Amateurfunk (1)

Arduino für FunkAmateure

Microcontroller VU Exam 1 (Programming)

JOY-iT TFT-Display 1.8

Ulrich Stein

rot red braun brown rot red RS-8 rot red braun brown R S V~

Messen von Gasmengen mit einfachen Mitteln. Version: 1.1 Datum: Autor: Dave Hoffmann

R&R. Ges. für Rationalisierung und Rechentechnik mbh. R&R RR-P-508 / ST106-EX1 motor-control unit

Monitor VIS 3xx Kurzanleitung

ADAM43-LCN-WQ-EDT. Datenblatt

Tag 4 7 Segment-Anzeige, File Include, LC-Display

LED Skalenbeleuchtung mit einem Arduino

TW-75-IP40Trackball. Trackball module of industrial applications, ball diameter 75 mm, degree of protection IP40. Description

ESP32 Pico-Board. ADC mit MCP ESP32 Addon. ADC- mit dem MCP3008. Vers. 1.0

Die WiFI Library( bei dem meisten recent?

Eingaben. Themen heute. Taster. Eingaben Zuweisungen Zeitmessung. Programmieren für Ingenieure Sommer Andreas Zeller, Universität des Saarlandes

RFID RC522. Ausgabe Copyright by Joy-IT 1

Dexatek's Alexa Smart Home Skills Instruction Guide

Programmieren des ESP8266 mit OLED

Einbauanleitung Komfort CAN Bus Interface 62240

Girls Day. Einführung Mikrocontroller,

Arduino Nano. Hello World per LED On-Board LED (Pin D13) Beispiel: Arduino IDE / Beispiele / Basics / Blink 5 / 20

Selbstbauprojekt 2017 GØ1

Magic Figures. We note that in the example magic square the numbers 1 9 are used. All three rows (columns) have equal sum, called the magic number.

DC/DC Hochspannungsmodule dbc-serie - Bedienungsanleitung

RFID RC522. Ausgabe Copyright by Joy-IT 1

Erste Schritte. Das Arduino-Board. Ihr Fundino-Board. Programmieren für Ingenieure Sommer Andreas Zeller, Universität des Saarlandes

Digital Inclinometer. Elektronischer Neigungmesser. Bedienungsanleitung

USB -> Seriell Adapterkabel Benutzerhandbuch

SINNsorik Wahrnehmen durch Sensoren NAME, KLASSE:

Arduino Digispark. Ausgabe Copyright by Joy-IT 1

RS-232 SERIAL EXPRESS CARD 1-PORT. Expansion

Application Note. Import Jinx! Scenes into the DMX-Configurator

TomTom WEBFLEET Tachograph

I8O8-USB. Serial Input and Output Board with. 8 Inputs 8 Outputs 8 ADC-Inputs USB (FTDI) Rev rtec.rohrhofer.org

myavr Programmierung in C

Mixed tenses revision: German

Can I use an older device with a new GSD file? It is always the best to use the latest GSD file since this is downward compatible to older versions.

Use of the LPM (Load Program Memory)

Lichtwürfel. Ein Projekt in der Vertiefung Prozessdatenverarbeitung. Michael Frey mail at mfrey dot net. July 3, 2008

11: Echtzeitbetriebssystem ucos-ii

Brand Label. Daimler Brand & Design Navigator

Quick Guide Home Network Mode

EL-21SY. 2 in, 1 out v1.3 HDMI Switcher OPERATION MANUAL

Microcontroller Selbststudium Semesterwoche 9

Einführung Arduino - Aufbau

German translation: technology

Transkript:

Arduino LCD Shield Quelle: http://www.dfrobot.com/wiki/index.php?title=arduino_lcd_keypad_shield_%28sku:_dfr0009%29

Arduino LCD Shield Codebeispiel /* DFRobot LCD Shield for Arduino Key Grab v0.2 Written by Glendon Klassen gjklassen@gmail.com http://www.sourceforge.net/users/ecefixer http://ecefixer.tumblr.com Displays the currently pressed key on the LCD screen. Key Codes (in left-to-right order): None - 0 Select - 1 Left - 2 Up - 3 Down - 4 Right - 5 */ #include <LiquidCrystal.h> #include <DFR_Key.h> // Pin assignments for DFRobot LCD Keypad Shield LiquidCrystal lcd(8, 9, 4, 5, 6, 7); //--------------------------------------------- DFR_Key keypad; int localkey = 0; String keystring = ""; void setup() lcd.begin(16, 2); lcd.clear(); lcd.setcursor(0, 0); lcd.print("key Grab v0.2"); delay(2500); /* OPTIONAL keypad.setrate(x); Sets the sample rate at once every x milliseconds. Default: 10ms */ keypad.setrate(10); void loop() /* keypad.getkey(); Grabs the current key. Returns a non-zero integer corresponding to the pressed key, OR Returns 0 for no keys pressed, OR Returns -1 (sample wait) when no key is available to be sampled. */ localkey = keypad.getkey(); if (localkey!= SAMPLE_WAIT) lcd.clear(); lcd.setcursor(0, 0); lcd.print("current Key:"); lcd.setcursor(0, 1); lcd.print(localkey); Quelle: http://www.dfrobot.com/wiki/index.php?title=arduino_lcd_keypad_shield_%28sku:_dfr0009%29

Arduino LCD Shield Quelle: http://www.dfrobot.com/wiki/index.php?title=arduino_lcd_keypad_shield_%28sku:_dfr0009%29

Anschluss - LCD Anzeige Pins D2, D3, D4,D5, D6, D7 sind identisch mit Arduino 4

ATmega8 Minimal Beschaltung

Standard LCD - Displays haben 16 Anschlüsse. Hierfür werden beim MyAvr Board die folgende Anschlüsse verwendet: LCD RS Pin digital Pin 2 Port B0 LCD Enable digital Pin 3 Port B1 LCD Data4 digital Pin 4 Port B2 LCD Data5 digital Pin 5 Port B3 LCD Data6 digital Pin 6 Port B4 LCD Data7 digital Pin 7 Port B5 Es werden nur 4 Datenleitungen genutzt - dies nennt man auch 4 Bit - Modus. Unter Arduino gibt es eine LCD Bibliothek - die uns viel Programmierarbeit abnimmt. Diese wird eingebunden mit: #include <LiquidCrystal.h> Wir können die LCD - Anzeige an beliebigen Pins anschließen. Die verwendeten Pins werden mit folgendem Befehl deklariert. LiquidCrystal lcd(2, 3, 4, 5, 6, 7); 6

Mit lcd.begin(16, 2) wird die Displaygröße angegeben. Dies ist meist 16 Zeichen - 2 Zeilen. Die Ausgabe von Zeichen auf dem Display erfolgt mit: lcd.print("lima 05") Text strings werden in " " eingebunden. Variablen können ausgeben werden mit: int val = 99; lcd.print(val); Mit lcd.setcursor(5, 1); wird der Cursur in Spalte 6, Zeile 2 gesetzt. Achtung die Zählung beginnt bei diesem Befehl mit 0. Weitere Befehle sind: lcd.clear(); lcd.home(); lcd.write(); lcd.nocursor(); LCD - Anzeige löschen Cursur auf oben links setzen einen Buchstaben ausgeben Cursor verstecken 7

// Beispielprogramm LCD Ausgabe #include <LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); void setup() lcd.begin(16, 2); //LCD Bibliothek einbinden // Initialize LCD Pins // Setup für 2 x 16 Display void loop() lcd.print("lima 05"); // Zeile 1 lcd.setcursor(0, 1); // Setze Cursor auf Spalte 0, Zeile 2 // Achtung: Die Zählung beginnt mit 0 lcd.print("dl0er"); 8

// Input und Output mit LCD #include <LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); int ledpin1 = 8; int inpin = 13; int val = 0; void setup() pinmode(ledpin1, OUTPUT); pinmode(inpin, INPUT); digitalwrite(inpin, HIGH); lcd.begin(16, 2); lcd.print("lima 05"); void loop() val = digitalread(inpin); if (val == 0) digitalwrite(ledpin1, HIGH); lcd.setcursor(0, 1); lcd.print("taste "); else digitalwrite(ledpin1, LOW); lcd.setcursor(0, 1); lcd.print("keine Taste"); // LED Pin8 PB0 // Taster Pin13 - PB5 // Variable für Eingangswert // setze Pin8 als Ausgang // setze Pin13 als Eingang // Pull Up Eingang auf High // Lese Eingangs - Pin // Schalte LED 9

Graphik Display - IL9341-2,2-240x320 Ebay 7.. 15 Hilfsspannung 3.3 / 5 V Pegel 3.3 V 2.2 Display 240 x 320 px Serielle Ansteuerung

Graphik Display - IL9341-2,2-240x320

Graphik Display - IL9341-2,2-240x320

Kommunikation über den SPI - Bus SPI library This library allows you to communicate with SPI devices, with the Arduino as the master device. A Brief Introduction to the Serial Peripheral Interface (SPI) Serial Peripheral Interface (SPI) is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. It can also be used for communication between two microcontrollers. With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. Typically there are three lines common to all the devices: MISO MOSI SCK (Master In Slave Out) - The Slave line for sending data to the master, (Master Out Slave In) - The Master line for sending data to the peripherals, (Serial Clock) - The clock pulses which synchronize data transmission generated by the master and one line specific for every device: SS (Slave Select) - the pin on each device that the master can use to enable and disable specific devices.

TFT 2.2 SPI 240 x 320, ILI 9341 Verdrahtung TFT Display Arduino Mini Pro +5 V 1 + 5 V o +5 V GND 2 4,7 k o GND CS 3 o RESET 4 o D / C 5 4,7 k o D6 10 k MOSI 6 4,7 k o D11 10 k SCK 7 4,7 k o D10 10 k LED 8 47 Ohm o MISO 9 SD CS SD MOSI SD MISO SD SCK Nicht verdrahtet Achtung: Die Eingänge des Displays vertragen nur 3,3 V! Zusätzlich müssen 2 Taster von Pin 2 + 3 des Arduino gegen Masse geschaltet werden.

Arduino Ucglib - Library Library und Beispiele: https://github.com/olikraus/ucglib_arduino/archive/v1.02-pre4.zip Beschreibung und Tutorial https://github.com/olikraus/ucglib/wiki

Hallo World Beispiel #include <SPI.h> #include "Ucglib.h" // Hardware SPI Pins: // Arduino Uno sclk=13, data=11 // Arduino Due sclk=76, data=75 // Arduino Mega sclk=52, data=51 Ucglib_ILI9341_18x240x320_SWSPI ucg(/*sclk=*/ 10, /*data=*/ 11, /*cd=*/ 6, /*cs=*/ 5, /*reset=*/ 4); void setup(void) delay(1000); ucg.begin(ucg_font_mode_transparent); //ucg.begin(ucg_font_mode_solid); ucg.clearscreen(); void loop(void) //ucg.setrotate90(); ucg.setfont(ucg_font_ncenr14r); ucg.setcolor(255, 255, 255); ucg.setcolor(255, 0, 0); //ucg.setcolor(0, 255, 0); ucg.setcolor(1, 255, 0,0); ucg.setprintpos(0,25); ucg.print("hello World!"); ucg.setprintpos(1,50); ucg.print("hello World!"); delay(500);

UCG Library Beispiele Bildschirm löschen ucg.clearscreen(); Horizontale Linie zeichnen - drawhline void Ucglib::drawHLine(ucg_int_t x, ucg_int_t y, ucg_int_t len) ucg.setcolor(255, 255, 255); ucg.drawhline(ucg, 50, 40, 45); Linie zeichnen - drawline void Ucglib::drawLine(ucg_int_t x1, ucg_int_t y1, ucg_int_t x2, ucg_int_t y2) Ucg.SetColor(255, 255, 255); ucg.drawhline(40, 45, 100, 145); Text ausgeben im Transperent Modus ucg.begin(ucg_font_mode_transparent); ucg.setfont(ucg_font_ncenr14r); ucg.setprintpos(0,25); ucg.setcolor(255, 255, 255); ucg.print("hello World!"); Text ausgeben im überdeckenden Modus ucg.setfont(ucg_font_ncenr14r); ucg.setfontmode(ucg_font_mode_solid); ucg.setprintpos(42, 40); ucg.setcolor(0, 0, 0, 0); ucg.setcolor(1, 150, 220, 255); ucg.print("ucg"); // do not use _tf for UCG_FONT_MODE_SOLID // black color for the text // light blue for the background Referenz (Beschreibung) unter: https://github.com/olikraus/ucglib/wiki/reference