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.