itoa (myservo1.read(), val2, 10);
SPI_Uart_print("servo1=");
SPI_Uart_print(val2);
delay(90);
}
// auto photocell
if (ph == 1){
for(i = 0; i < 180; i++){
val = analogRead(photoPin);
if(ph_val!=val){
if(ph_val<val-5){
if((myservo.read()-
1<=181)&&(myservo.read()-1>=0)){
myservo.write(myservo.read()-1);
}
}
if(ph_val>val+5){
if((myservo.read()+1<=180)&&(myservo.read()+1>=0)){
myservo.write(myservo.read()+1);
}
}
delay(10);
}
}
}
if(SPI_Uart_ReadByte(LSR) & 0x01){
Serial.println("Client request...");
Parse_Request(); // Check if request is a
GET/POST
Flush_RX();
return 1;
}
Kommentare zu diesen Handbüchern