whats wrong with this:
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() //
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16, 2); // initialize the lcd for 16 chars 2 lines, turn on backlight
for (int i = 0; i < 3; i++)
{
lcd.backlight(); // turn on backlight.
delay(20);
lcd.noBacklight(); // turn off backlight
delay(20);
}
lcd.backlight(); // finish with backlight on
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0, 0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(2000);
lcd.setCursor(0, 1);
lcd.print("ADAMINNOVATIONS.com");
delay(5000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0, 0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0, 1);
lcd.print("Type to display");
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
nanolcd(); //LOOP of 'UNO_LCD16X2_I2C_GOOD_TYPE_NANO';
nanopotvary(); //LOOP of 'NANO_T1_POT_VARY';
}
void nanolcd() {
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
void nanopotvary() {
PWMFreValueA = analogRead(NANOFrePotPinA); // read the value from the nanofrepotPin
Serial.println("NANOFrePotPinA = "); //Prints "Setup" to the serial monitor
Serial.println(NANOFrePotPinA);
PWMFreValueA = map (PWMFreValueA, 0, 1023, 0, 600);
Serial.println("PWMFreValueA READ"); //Prints "Setup" to the serial monitor
Serial.println(PWMFreValueA);
PWMDutyValueA = analogRead(NANODutyPotPinA); // read the value from the nanodutypotPin
Serial.println("NANODutyPotPinA = "); //Prints "Setup" to the serial monitor
Serial.println(NANODutyPotPinA);
PWMDutyValueA = map (PWMDutyValueA, 0, 1023, 0, 600);
}
errors:
Arduino: 1.8.8 (Windows 7), TD: 1.45, Board: "Arduino Nano, ATmega328"
C:\Users\HUA.DELLV-PC\Documents\Arduino\NANO_MOSFET_POT_LCD16X2_I2C_CHARGER_post\NANO_MOSFET_POT_LCD16X2_I2C_CHARGER_post.ino: In function 'void setup()':
NANO_MOSFET_POT_LCD16X2_I2C_CHARGER_post:41:3: error: a function-definition is not allowed here before '{' token
{
^
NANO_MOSFET_POT_LCD16X2_I2C_CHARGER_post:48:17: error: a function-definition is not allowed here before '{' token
void nanolcd(){
^
NANO_MOSFET_POT_LCD16X2_I2C_CHARGER_post:82:9: error: expected '}' at end of input
}
^
Multiple libraries were found for "Wire.h"
Used: C:\Users\HUA.DELLV-PC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\Wire
Not used: C:\Program Files (x86)\Arduino\libraries\Wire-master
Multiple libraries were found for "LiquidCrystal_I2C.h"
Used: C:\Program Files (x86)\Arduino\libraries\NewLiquidCrystal_lib
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C-library-master
Not used: C:\Program Files (x86)\Arduino\libraries\Arduino-LiquidCrystal-I2C
exit status 1
a function-definition is not allowed here before '{' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.