Hi . I've already searched the error message on Google and there was ONE result which wasn't the error I had (Google seriously has to make better systems ) I know this is a kind of famous error and is no tough one .
The 1602 display has an I2C board on the back with potentiometer and a shift register and etc etc which leaves Vin (VCC) and Negative (GND) plus SDA and SCL . Connection was done correctly with arduino uno's pin analog 5 as SCL and 4 as SDA (Power is supplied from arduino)
I've tested it with a sample code provided and it worked , so the LCD is fine as well :
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
}
This is the sample code .
The libraries support some codes (really awesome and handy codes . They seriously make programming easier )
LiquidCrystal()
begin()
clear()
home()
setCursor()
write()
print()
cursor()
noCursor()
blink()
noBlink()
display()
noDisplay()
scrollDisplayLeft()
scrollDisplayRight()
autoscroll()
noAutoscroll()
leftToRight()
rightToLeft()
createChar()
But I'm not using a lot of these . I'm using this code which involves random , if , else if , and some of these . That code is attached (it was long (the code itself was short but lots of little lines , pretty annoying to put here ! ))
The basic idea is that if random from 1 to 10 would be 2 , the lcd would print something . Or if it became 5 , something else . The only complicated part is if it becomes 7 , where it blinks , prints "FATAL ERROR" , gets clear for a second then writes "ERROR" , gets clear and stops blinking .
This is a kind of device that is helpful for decisions (and if the random becomes 7 , it'd play a prank)
Then the error I receive :
It compiles 100 % and suddenly some orange words appear :
avrdude: stk500_getsync(): not in sync: resp=0x30
The reason is that It's set up to COM3 whilst I'm connecting it from COM4 . I don't know , I received an error which said COM4 was busy and I could use COM3 . I accepted and then when I try to compile it keeps saying this .
Drivers have been installed correctly .
Only question is how can I switch to COM4 to continue ?
Thanks in advance .
LCD.ino (834 Bytes)