CPP 260
HOMEWORK,FIRE/SHAMSALIZADEH Guest on 20th October 2023 06:09:16 PM
  1. #define IR A2
  2. #define PUMP 3
  3. #define AL 4
  4. void setup() {
  5.   // put your setup code here, to run once:
  6. pinMode(PUMP , OUTPUT );
  7. pinMode(AL , OUTPUT );
  8. digitalWrite(PUMP , LOW);
  9. digitalWrite(AL , LOW);
  10. }
  11. void loop() {
  12.   // put your main code here, to run repeatedly:
  13. int x = analogRead(x);
  14. if (x>400){
  15.   digitalWrite(PUMP , HIGH);
  16.   digitalWrite(AL , HIGH);
  17.   }
  18. else{
  19. digitalWrite(PUMP , LOW);
  20. digitalWrite(AL , LOW);
  21. }
  22. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.