sábado, 21 de outubro de 2017

DISPLAY NOKIA Arduino Mega 2560

Arduino MEGA 2560

Default:
int RESET = 3;
int CS = 4; // CE, CS
int DC = 5;
int DIN = 6;
int CLK = 7;
Adafruit_PCD8544 display1 = Adafruit_PCD8544(CLK, DIN, DC, CS, RESET);

Default com comunicação mais rápida:
int RESET = 3;
int CS = 4; // CE, CS
int DC = 5;
int DIN = 11;
int CLK = 13;
Adafruit_PCD8544 display1 = Adafruit_PCD8544(CLK, DIN, DC, CS, RESET);

Multidisplay:
int d1_RESET = 23;
int d1_CS = 25; // CS/CE
int d1_DC = 27;
int d1_DIN = 29; //6
int d1_CLK = 31; //7

Adafruit_PCD8544 display1 = Adafruit_PCD8544(d1_CLK, d1_DIN, d1_DC, d1_CS, d1_RESET);

int d2_RESET = 22;
int d2_CS = 24; // CS/CE
int d2_DC = 26;
int d2_DIN = 28; //6
int d2_CLK = 30; //7

Adafruit_PCD8544 display2 = Adafruit_PCD8544(d2_CLK, d2_DIN, d2_DC, d2_CS, d2_RESET);

Display ERM240128SYG-2 240x128

4.7"Graphic LCD 240x128 T6963

/* display Arduino mega 2560
 *  1 FG   GND 
 *  2 GND  GND
 *  3 VDD  5V
 *  4 V0   POT(2)
 *  5 /WR   6
 *  6 /RD   5
 *  7 CE   GND
 *  8 C/D   3
 *  9 RST   2
 * 10 D0   22
 * 11 D1   23
 * 12 D2   24
 * 13 D3   25
 * 14 D4   26
 * 15 D5   27
 * 16 D6   28
 * 17 D7   29
 * 15 FS1  GND
 * 19 VEE  POT(3)
 * 20 LEDA 3.3V
 * 21 LEDK GND
 *         POT(1) GND
 */

#define d0    22
#define d1    23
#define d2    24
#define d3    25
#define d4    26
#define d5    27
#define d6    28
#define d7    29
#define reset  2
#define cd     3
#define ce     4
#define rd     5
#define wr     6


U8GLIB_T6963_240X128 u8g(d0, d1, d2, d3, d4, d5, d6, d7, ce, cd, wr, rd, reset);

Lentidão utilizando a biblioteca U8GLIB.

================================================================


domingo, 8 de maio de 2016

Display 192x64

Display 192x64

ERM19264SYG-1


Part number...................: ERM19264SYG-1
Display format................: 192x64 Dots
Interface.....................: 6800 8-bit Parallel
IC or equivalent..............: S6B0107 , S6B0108
Diagonal size.................: 4.0"
Visual area...................: 104.00 x 39.00 mm
Sunlight readable.............: yes
Backlight current.............: 120mA
Power supply..................: 5V
Supply current for LCM(Max)...: 7mA

Module       | Description |  UNO  | Arduino MEGA

-------------+-------------+-------+-------------
http://playground.arduino.cc/Code/GLCDks0108
Module       | Description |  UNO  | Arduino MEGA
-------------+-------------+-------+-------------
    VSS [01] = GND         =       = GND
    VDD [02] = VCC         =       = +5V
     Vo [03] = CONTRAST    =       = POT2
  RS,DI [04] =             = [   ] = [D36]
    R/W [05] =             = [   ] = [D35]
     EN [06] =             = [   ] = [D37]
     D0 [07] =             = [   ] = [D22]
     D1 [08] =             = [   ] = [D23]
     D2 [09] =             = [   ] = [D24]
     D3 [10] =             = [   ] = [D25]
     D4 [11] =             = [   ] = [D26]
     D5 [12] =             = [   ] = [D27]
     D6 [13] =             = [   ] = [D28]
     D7 [14] =             = [   ] = [D29]
   /CS1 [15] =             = [   ] = [D33]
   /RST [16] =             = [   ] = [D30]
   /CS2 [17] =             = [   ] = [D32]
   /CS3 [18] =             = [   ] = [D34]
   LedA [19] =             = [   ] = POT3
   LedK [20] =             = [   ] = +5V
   POT1 [  ] =             = [   ] = GND


Library......: OpenGLCD

Arquivo......: \libraries\openGLCD\openGLCD_Config.h
linha........: 90
ação.........: descomentar

#define GLCDCFG_GLCDCONFIG "config/ks0108/AutoConfig_ks0108-HJ19264A_Panel.h"



Arquivo......: \libraries\openGLCD\config\hd44102\ManualConfig_hd44102_Panel.h
linha........: 72
ação.........: descomentar e alterar

// backlight control pin

#define glcdPinBL 30 // optional backlight control pin controls BL circuit

domingo, 24 de abril de 2016

VSS NO ARDUINO

VSS (VEHICLE SPEED SENSOR) NO ARDUINO COM 4N25




1 x 4N25
2 x resistor 4k7
1 x diodo 1n4148
1 x VSS AUTOMOTIVO 3 fios

código
===
int pino = 11;
int led = 13;
int old;
int valor;

void setup(){
  Serial.begin(115200);
  Serial.println("inicio");
  pinMode(pino, INPUT);
  pinMode(led, OUTPUT);
}


void loop(){
  valor = digitalRead(pino);
  if(valor != old){
    Serial.println( valor);
    if( digitalRead(pino) ){
      digitalWrite(13, HIGH);
    }else{
      digitalWrite(13, LOW);
    }
    old = valor;
  }

}
===
volatile int iIRQ2_Count;
int IRQ2_PIN = 2;
int IRQ2_IRQ = 0;

void setup(){
  // Put your setup code here, to run once:
  Serial.begin (9600);
  attachInterrupt(IRQ2_IRQ, IRQ2_Counter, RISING);
  delay(25);
  detachInterrupt(IRQ2_PIN);
  Serial.print(F("Counted = "));
  Serial.println(iIRQ2_Count);
}

void IRQ2_Counter() {
  iIRQ2_Count++;
}

void loop() {
  Serial.println(iIRQ2_Count);
  iIRQ2_Count = 0;
  delay(1000);

}

domingo, 10 de abril de 2016

Display 20x4 4b J204A

Display LCD 20x4 4bit
J204A
Module       | Description |  UNO  | Arduino MEGA
-------------+-------------+-------+-------------
    VSS [01] = GND         =       = GND
    VDD [02] = VCC         =       = +5V
     Vo [03] = CONTRAST    =       = POT
  RS,DI [04] =             = [   ] = [D12]
    R/W [05] =             = [   ] = [D11]
     EN [06] =             = [   ] = [D10]
     D0 [07] =             = [   ] = [   ]
     D1 [08] =             = [   ] = [   ]
     D2 [09] =             = [   ] = [   ]
     D3 [10] =             = [   ] = [   ]
     D4 [11] =             = [   ] = [D05]
     D5 [12] =             = [   ] = [D04]
     D6 [13] =             = [   ] = [D03]
     D7 [14] =             = [   ] = [D02]
      A [15] =             = [   ] = +5V
      K [16] =             = [   ] = GND
-------------+-------------+-------+-------------

quinta-feira, 7 de abril de 2016

ER-TFTM035-6

Minha versão para a conexão do ER-TFTM035-6 para o Arduino Mega 2560, da buydisplay.com.

       (ILI9488)
    ER-TFTM035-6 = Arduino MEGA 2560
================JP1================
        GND [01] = -
        VDD [02] = +
  /RESET_NC [21] = [44]
         TE [22] = 
    LCD_/CS [23] = [53] SS, CS
   /WR(SCL) [24] = [52] SCK
        D/C [25] = [48]
        /RD [26] = 
    LCD_SDI [27] = [51] MOSI, SI
    LCD_SDO [28] = [50] MISO, SO

         GND[40] = -


Obs: ainda não consegui fazê-lo funcionar.


Talvez algo esteja errado na conexão ou a biblioteca que estou usando para o Mega esteja errada.