This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * playing the imperial march with a buzzer. got the tabs from here: https://gist.github.com/tagliati/1804108 | |
| * | |
| */ | |
| #include "pitches.h" | |
| int PIN_BUZZER = 9; | |
| // eH -> NOTE_E5 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | int PIN_BUZZER = 9; | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(PIN_BUZZER, OUTPUT); | |
| } | |
| void loop() { | |
| analogWrite(PIN_BUZZER, 255); | |
| delay(1); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | int PIN_LED = 9; | |
| int PIN_INPUT = 2; | |
| int pirState = 0; | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(PIN_LED, OUTPUT); | |
| pinMode(PIN_INPUT, INPUT); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | int PIN_LED = 9; | |
| int brightness = 0; | |
| int fadeAmount = 5; | |
| void setup() { | |
| pinMode(PIN_LED, OUTPUT); | |
| Serial.begin(9600); | |
| } | |
| void loop() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void setup() { | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| int sensorValue = analogRead(A0); | |
| Serial.println(sensorValue); | |
| delay(1); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | int PIN_LED = 13; | |
| int pin_state = 0; | |
| void setup() { | |
| // put your setup code here, to run once: | |
| } | |
| void loop() { | |
| pin_state = (pin_state + 1) % 2; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | int ledPin = 13; // LED | |
| int pirPin = 2; // PIR Out pin | |
| int pirStat = 0; // PIR status | |
| void setup() { | |
| pinMode(ledPin, OUTPUT); | |
| pinMode(pirPin, INPUT); | |
| Serial.begin(9600); | |
| } | |
| void loop(){ | |
| pirStat = digitalRead(pirPin); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /* | |
| * created by Rui Santos, https://randomnerdtutorials.com | |
| * | |
| * Complete Guide for Ultrasonic Sensor HC-SR04 | |
| * | |
| Ultrasonic sensor Pins: | |
| VCC: +5VDC | |
| Trig : Trigger (INPUT) - Pin11 | |
| Echo: Echo (OUTPUT) - Pin 12 | |
| GND: GND | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const int pwm = 3 ; //initializing pin 2 as pwm | |
| const int in_1 = 8 ; | |
| const int in_2 = 9 ; | |
| //For providing logic to L298 IC to choose the direction of the DC motor | |
| void setup() | |
| { | |
| pinMode(pwm,OUTPUT) ; //we have to set PWM pin as output | |
| pinMode(in_1,OUTPUT) ; //Logic pins are also set as output |