- #define IR A2
- #define PUMP 3
- #define AL 4
- void setup() {
- // put your setup code here, to run once:
- pinMode(PUMP , OUTPUT );
- pinMode(AL , OUTPUT );
- digitalWrite(PUMP , LOW);
- digitalWrite(AL , LOW);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- int x = analogRead(x);
- if (x>400){
- digitalWrite(PUMP , HIGH);
- digitalWrite(AL , HIGH);
- }
- else{
- digitalWrite(PUMP , LOW);
- digitalWrite(AL , LOW);
- }
- }
Recent Pastes