CPP 271
Police By Hightechrobo on 24th December 2023 01:34:25 PM
  1. const int analogInPin = A0;
  2. int sensorValue = 0;
  3. int timer = 0;
  4. void setup() {
  5.   // put your setup code here, to run once:
  6. pinMode (12, OUTPUT);
  7. pinMode(11, OUTPUT);
  8. }
  9.  
  10. void loop() {
  11.   // put your main code here, to run repeatedly:
  12. sensorValue = analogRead(analogInPin);
  13. timer = map (sensorValue, 0, 1023, 10, 500);
  14. digitalWrite(12, HIGH);
  15. delay(timer);
  16. digitalWrite (12 , LOW);
  17. delay(timer);
  18. digitalWrite(12, HIGH);
  19. delay(timer);
  20. digitalWrite (12 , LOW);
  21. digitalWrite(11, HIGH);
  22. delay(timer);
  23. digitalWrite (11 , LOW);
  24. delay(timer);
  25. digitalWrite(11, HIGH);
  26. delay(timer);
  27. digitalWrite (11 , LOW);
  28. }

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.