All my inputs (PINL) are fine over serial monitor but now that iam using an LCD screen ..i have only got it to print my if statements 3 times..is lcd.print slowing the code down ..any ideas?
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
DDRL = 0b00000000; // Sets ports to read
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("DRERSCSNCLCHSDCR"); // abbreviations for registers DR-ER-SC-SN-CL-CH-SD-CR
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0,1);
if (PINL == 0b01000010) //if PINL returns the right value print "OA" under DR thats always printed to the lcd
lcd.print("OA");
lcd.setCursor(2,1);
if (PINL == 0b01001010) //if PINL returns the right value print "1A" under ER thats always printed to the lcd
lcd.print("1A");
lcd.setCursor(4,1);
if (PINL == 0b01010010) //if PINL returns the right value print "2A" under SC thats always printed to the lcd
lcd.print("2A");
lcd.setCursor(6,1);
if (PINL == 0b01011010) //if PINL returns the right value print "3A" under SN thats always printed to the lcd
lcd.print("3A");
lcd.setCursor(8,1);
if (PINL == 0b01100010) //if PINL returns the right value print "4A" under CL thats always printed to the lcd
lcd.print("4A");
lcd.setCursor(10,1);
if (PINL == 0b01101010) //if PINL returns the right value print "5A" under CH thats always printed to the lcd
lcd.print("5A");
lcd.setCursor(12,1);
if (PINL == 0b01110010) //if PINL returns the right value print "6A" under SD thats always printed to the lcd
lcd.write("6A");
lcd.setCursor(14,1);
if (PINL == 0b01111010) //if PINL returns the right value print "7A" under CR thats always printed to the lcd
lcd.print("7A");
}