Isd Code4
Isd Code4
h>
#include <Key.h>
#include <Keypad.h>
//#include <LiquidCrystal_I2C.h>
/*#include <Keypad.h>
#include <LiquidCrystal_I2C.h>*/
const int rs = 2, en = 3, d4 = 10, d5 = 11, d6 = 12, d7 = 13;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
//Motor A
const int motorDirectionPin = A3;
const int motorSpeedPin = A2;
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'-', '0', '+'}
};
void setup(){
Serial.begin(9600);
lcd.begin(16, 2);
lcd.clear();
//lcd.backlight(); // Make sure backlight is on
lcd.setCursor(4,0);
lcd.print("Welcome!");
//lcd.setCursor(0,1);
//lcd.print("Dr. Prajit Nandi");
delay(3000);
lcd.clear();
delay(1000);
lcd.setCursor(1,0);
lcd.print("Stroboscope is");
lcd.setCursor(5,1);
lcd.print("ready!");
delay(3000);
lcd.clear();
deftxt();
pinMode(9, OUTPUT);
// initialize the pushbutton pin 11,10,12 as an input:
pinMode(A0, INPUT);
pinMode(A1, INPUT);
// pinMode(A2, INPUT);
pinMode(motorDirectionPin, OUTPUT);
pinMode(motorSpeedPin, OUTPUT);
}
void loop(){
//Stroboscope LED blinking
if (signalState == 1){
float y = 60000.0 / rpm;
digitalWrite(9, HIGH);
delay(y);
digitalWrite(9, LOW);
delay(y);
}