Hi guys,
I'm trying to make an analog clock with a servo motor without RTC module.
At the beginning it was all ok, but, when i tried to order the code with comments and spaces, the "does not a name type" error appears for each object.
// 22/07/2017
// ANALOG CLOCK
// *Riccardo*
//--------------library---------------\\
#include <LiquidCrystal.h> //lcd
#include <Servo.h>Â Â Â Â //servo
#include "IRremote.h"Â Â Â //IR
//--------------------------------------\\
//------------------objects--------------------------\\
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);Â Â //LCD pin
Servo wiper;Â Â //servo name
int receiver = 3;Â Â //IR receiver pin
//----------------------------------------------------\\
//----------------------instances----------------------\\
IRrecv irrecv(receiver); //instance of 'irrecv'
decode_results results; //instance of 'decode_results'
//-------------------------------------------------------\\
//-----------variables-----------\\
int h = 5;Â //ora
int m = 06;Â Â //minuti
int s = 0;Â //secondi
int flag;
int TIME;
int state1;
int state2;
//-------------------------------\\
//-------------------VOID SETUP------------------------------------\\
void setup() {
 Serial.begin(9600); //Serial port begin\\
 irrecv.enableIRIn(); // Start IR receiver \\
 lcd.begin(16, 2); //start LCD screen (16 columns, 2 rows)
 wiper.attach(6); //start servo motor on pin 6
}
//------------------------------------------------------------------\\
//----------------------VOID LOOP---------------------------------------\\
void loop() {
 s = s + 1; //add 1 second
 //--------------TIME---------------------------------------------------\\
 Serial.println(h ":" m ":" s); //print to serial monitor H, M, S
 //-------------AM/PM DECODER-----------\\
 if (flag < 12) Serial.println("AM");
 if (flag == 12) Serial.println("PM");
 if (flag > 12) Serial.println("PM");
 if (flag == 24)flag = 0;
 //--------------------------------------\\
 delay(1000); //delay 1 second
 //if 60 second -> add a minute\\
 if (s == 60) {
  s = 0;
  m = m + 1;
 }
 //if 60 minute -> add an hour\\
 if (m == 60) {
  m = 0;
  h = h + 1;
  flag = flag + 1;
 }
 //if 13 hour -> back to 1 hour
 if (h == 13)
 {
  h = 1;
 }
 //-------------------------END TIME------------------------------\\
 wiper.write((h * 14)); //set servo to hour
 //-----------lcd time display-----------\\
 lcd.clear();
 lcd.setCursor (1, 0);
 lcd.print("ORA");
 lcd.setCursor(6, 0);
 lcd.print("MIN");
 lcd.setCursor(12, 0);
 lcd.print("SEC") ;
 lcd.setCursor(2, 2);
 lcd.print(h);
 lcd.setCursor(7, 2);
 lcd.print(m);
 lcd.setCursor(13, 2);
 lcd.print(s);
 //----------------------------------------\\
}