Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

int LED = 13;

int lightPin AO;


int lightVa1ue;
int lightThres 30;
int butpin 8;
int butVa1ue ;

void setup ) {
(

pinMode (LED, OUTPUT) ;


pinMode (butpin, INPUT) ;

Serial begin (9600) ;


.

void loop ( {)

lightVa1ue=ana10gRead (lightPin) ;
butVa1ue=digita1Read (butpin) ;
delay (1) ;
Serial print In (lightVa1ue) ;
.

Serial println (butVa1ue) ;


.

if (lightVa1ue < lightThres or butVa1ue HIGH) {

digitalWrite (LED, HIGH) ;


}else{
digitalWrite (LED, LOW) ;

You might also like