72
if (current == LOW){ // reset the counter if the button is
not pressed
count = 0;
}
previous = current;
// photocell value
if (photo == 1){
val = analogRead(photoPin);
itoa (val, val2, 10);
SPI_Uart_print("photo=");
SPI_Uart_print(val2);
delay(90);
}
// servomotor
if (servo == 1){
itoa (myservo.read(), val2, 10);
SPI_Uart_print("servo=");
SPI_Uart_print(val2);
delay(90);
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)){
Kommentare zu diesen Handbüchern