#include <LiquidCrystal.h>
// #include "TimerOne.h"
LiquidCrystal lcd(12,11,5,4,3,2);
unsigned long prevTime=0;
volatile int sensorValue=0;
void setup() {
lcd.begin(16,2);
lcd.print("hello");
// Timer1.initialize(100000);
// Timer1.attachInterrupt(softInterr);
// lcd.write(softInter);
}
void loop() {
unsigned long currTime=millis();
if (currTime-prevTime>=1000){
prevTime=currTime;
lcd.print(sensorValue);
sensorValue=analogRead(A0);
lcd.clear();
lcd.print(sensorValue);
}
}
// void softInterr(){
// }
// if (millis()-time>period_speed){
for (pos = 0; pos <= 140; pos ++) {
// if (pos==140){
servo1.write(pos);
delay(50);
// }
}
for (pos = 0; pos <= 110; pos ++) {
// if (pos==110){
servo2.write(pos);
delay(50);
// }
}
for (pos = 0; pos <= 90; pos ++) {
// if (pos==90){
servo3.write(pos);
delay(50);
// }
}
for (pos = 0; pos <= 50; pos ++) {
// delay(50);
// if(pos==50){
servo4.write(pos);
delay(50);
// }
}
// }