hi,everybody.
please can me write program following issue?
in fact want write program use parking lot.
the input used p1 barrier @ car park entrance .
and p2 input used barrier @ exit of parking lot
led1 must indicate when there 5 cars in parking lot .
led2 must indicate when there less 5 in parking lot .
bellow how started not know how continue need help
#define led1 4
#define led2 5
#define led1on digitalwrite (led1,0)
#define led1off digitalwrite (led1,1)
#define led2on digitalwrite (led2,0)
#define led2off digitalwrite (led2,1)
#define p1 2
#define p2 3
#define p1on (digitalread (p1)==0)
#define p2on (digitalread (p2)==0)
void setup() {
pinmode (p1,input);
pinmode (p2,input);
pinmode (led1,output);
pinmode (led2,output);
}
void loop() {
// want program put here:
}
please can me write program following issue?
in fact want write program use parking lot.
the input used p1 barrier @ car park entrance .
and p2 input used barrier @ exit of parking lot
led1 must indicate when there 5 cars in parking lot .
led2 must indicate when there less 5 in parking lot .
bellow how started not know how continue need help
#define led1 4
#define led2 5
#define led1on digitalwrite (led1,0)
#define led1off digitalwrite (led1,1)
#define led2on digitalwrite (led2,0)
#define led2off digitalwrite (led2,1)
#define p1 2
#define p2 3
#define p1on (digitalread (p1)==0)
#define p2on (digitalread (p2)==0)
void setup() {
pinmode (p1,input);
pinmode (p2,input);
pinmode (led1,output);
pinmode (led2,output);
}
void loop() {
// want program put here:
}
how know how many cars/spaces there are?
Arduino Forum > Using Arduino > Programming Questions > arduino programing
arduino
Comments
Post a Comment