/**
Arduino Electronic Safe
Copyright (C) 2020, Uri Shaked.
Released under the MIT License.
*/
#include <LiquidCrystal.h>
/* Locking mechanism definitions */
#define A5_Val A5
#define A4_Val A4
#define A3_Val A3
#define pwm6 6
#define pwm5 5
#define pwm3 3
int iVoltageA5 = 0;
int iVoltageA4 = 0;
int iVoltageA3 = 0;
/* Display */
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
lcd.begin(16, 2);
pinMode(pwm6, OUTPUT);
pinMode(pwm5, OUTPUT);
pinMode(pwm3, OUTPUT);
analogWrite(pwm6,250);
analogWrite(pwm5,128);
analogWrite(pwm3,200);
}
void loop() {
iVoltageA5 = analogRead(A5_Val);
iVoltageA4 = analogRead(A4_Val);
iVoltageA3 = analogRead(A3_Val);
lcd.setCursor(0, 0);
lcd.print("A5 A4 A3 ");
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(iVoltageA5);
lcd.setCursor(6, 1);
lcd.print(iVoltageA4);
lcd.setCursor(12, 1);
lcd.print(iVoltageA3);
delay(500);
}