You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 line
351B

  1. /*
  2. *@author James McKenzie
  3. *@lang C89 Based
  4. *@contact lunarised@outlook.com
  5. */
  6. int mode;
  7. void setup() {
  8. pinMode(0, INPUT_PULLUP);
  9. pinMode (13, OUTPUT);
  10. pinMode(8, OUTPUT);
  11. if (digitalRead(0) ==HIGH){
  12. mode = 0;
  13. }
  14. else{
  15. mode = 1;
  16. }
  17. }
  18. void loop() {
  19. if (mode == 0){
  20. digitalWrite(13, HIGH);
  21. tone(8, 440);cd
  22. }
  23. }