Categorii




   Comanda Direct Furnizor
   Consultanta Tehnica
   Ticket Garantie
   Problema Livrare
   Retur Produse
   Feedback
   Verifica Status


RETRAS - LCD Grafic 128x64 Serial

RETRAS - LCD Grafic 128x64 Serial
RETRAS - LCD Grafic 128x64 Serial RETRAS - LCD Grafic 128x64 Serial RETRAS - LCD Grafic 128x64 Serial RETRAS - LCD Grafic 128x64 Serial RETRAS - LCD Grafic 128x64 Serial
Brand: Sparkfun
Cod Produs: LCD-16 398
Acest produs nu mai face parte din oferta Robofun pentru ca a aparut o versiune mai noua.
Pret: 175 RON (TVA inclus)

 

Ecranul LCD Grafic Serial permite :

  • afisarea de text
  • desenare de linii, cercuri si dreptunghiuri
  • control asupra fiecarui pixel(set/reset)

 

Dispozitivul se cupleaza la Arduino prin trei fire : VCC si GND, cuplate respectiv la portul de 5 V si GND al Arduino, si un al treilea fir pentru semnalul util, fir care se cupleaza pe portul TX al Arduino.

 

 

Specificatii:

Rezolutie: 128x64

Tensiune : 6V-7V 

Curent: 220mA

Input: 0-5V 115200 bps(ajustabil), 8 data bits, 1stop bits, no parity

Dimensiuni : 7,62 X 5,08 X 1.52 cm

 

 

 

Program:

 

 

// Graphic Serial LCD 128x64
 
// Arduino Pin 8 (RX) to LCD Pin TX (NOT USED, NOT NECESSARY)
 
// Arduino Pin 9 (TX) to LCD Pin RX
 
// Arduino Pin Vin to LCD Vin (Assuming you're powering Arduino externally with 9 VDC)
 
// Arduino Pin Gnd to LCD Pin Gnd
 
 
 
 
 
void setup() {
 
  Serial1.begin(115200);
 
 
 
  clearScreen();
 
 
 
  // Set a dim display
 
  setBackgroundBrightness(1);
 
 
 
  // Note how by default it prints at upper left
 
  print("hello");
 
 
 
  // Note that 0,0 is at lower left side of display
 
  setX(5);
 
  setY(10);
 
  print("world");
 
 
 
  // Draw a big X
 
  drawLine(0, 0, 127, 63, 1);
 
  drawLine(127, 0, 0, 63, 1);
 
 
 
  // Draw a centered circle
 
  drawCircle(63, 31, 31, 1);
 
 
 
  // Draw a box in the center
 
  drawBox(31, 15, 95, 47, 1);
 
 
 
 
void loop()
 
{
 
}
 
 
 
void print(char *data){
 
  Serial1.print(data);
 
}
 
 
 
void clearScreen(){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x00));
 
}
 
 
 
void demo(){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x04)); 
 
}
 
 
 
void toggleSplashScreen(){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x13)); 
 
}
 
 
 
void setBackgroundBrightness(byte value){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x02));
 
  Serial1.write(byte(value));
 
}
 
 
 
void setBaudRate(long value){
 
  // Get the internal reference for this baud rate
 
  char *ref = " ";
 
  if(value == 4800) 
 
    ref = "1";
 
  else if(value == 9600)
 
    ref = "2";
 
  else if(value == 19200)
 
    ref = "3";
 
  else if(value == 38400)
 
    ref = "4";
 
  else if(value == 57600)
 
    ref = "5";
 
  else if(value == 115200)
 
    ref = "6";
 
  else
 
    return;
 
 
 
  // Since it often rolls back to 115200, try setting it via 115200 first
 
  Serial1.begin(115200);
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x07));
 
  Serial1.print(ref);
 
 
 
  // Now change the serial port to the desired rate, and set it again.
 
  Serial1.begin(value);
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x07));
 
  Serial1.print(ref);
 
}
 
 
 
void setX(byte value){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x18C));
 
  Serial1.write(byte(value));
 
}
 
 
 
void setY(byte value){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x19));
 
  Serial1.write(byte(value));
 
}
 
 
 
void setPixel(byte state){
 
  Serial1.write(byte(0x50));
 
  Serial1.write(byte(0x40));
 
  Serial1.write(byte(state));
 
}
 
 
 
void drawLine(byte startX, byte startY, byte endX, byte endY, byte state){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x0C));
 
  Serial1.write(byte(startX));
 
  Serial1.write(byte(startY));
 
  Serial1.write(byte(endX));
 
  Serial1.write(byte(endY));
 
  Serial1.write(byte(state));
 
}
 
 
 
void drawCircle(byte startX, byte startY, byte radius, byte state){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x03));
 
  Serial1.write(byte(startX));
 
  Serial1.write(byte(startY));
 
  Serial1.write(byte(radius));
 
  Serial1.write(byte(state));
 
}
 
 
 
void drawBox(byte topLeftX, byte topLeftY, byte bottomRightX, byte bottomRightY, byte state){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x0F));
 
  Serial1.write(byte(topLeftX));
 
  Serial1.write(byte(topLeftY));
 
  Serial1.write(byte(bottomRightX));
 
  Serial1.write(byte(bottomRightY));
 
  Serial1.write(byte(state));
 
}
 
 
 
void eraseBox(byte topLeftX, byte topLeftY, byte bottomRightX, byte bottomRightY, byte state){
 
  Serial1.write(byte(0x7C));
 
  Serial1.write(byte(0x05));
 
  Serial1.write(byte(topLeftX));
 
  Serial1.write(byte(topLeftY));
 
  Serial1.write(byte(bottomRightX));
 
  Serial1.write(byte(bottomRightY));
 
  Serial1.write(byte(state));
 
}
 

 

 

 

Linkuri:

Datasheet (Descrie protocolul de comunicatie dintre Arduino si LCD)

Codul sursa pentru controllerul lcd

Proiect Ceas USB

Tutorial : update firmware

Scrie un review / pune o intrebare in zona de mai jos.

Intrebarea / review-ul tau va fi publicata pe site in cel mai scurt timp posibil (pe langa intrebarile scrise de clienti, cu acest formular mai interactioneaza si unii boti si servicii de spam automate care incearca sa ne vanda Viagra, postari pe care este necesar sa le filtram manual :)
.

Numele tau


Adresa ta de email (nu o vom face publica, nu va fi publicata nicaieri pe site)


Intrebarea / review-ul tau

Rating: Bad           Good


Introdu codul in caseta de mai jos:



Robofun © 2017