Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * LIGHTS, SOUND, ACTION!
- * ARDUINO AND ELECTRONICS WORKSHOP
- *
- * JANUARY 19, 2017: 3:30 - 6:00 PM
- * INSTRUCTOR: JUSTIN GONG
- * C-INNOVA, BOGOTA, COLOMBIA
- */
- // ************************************************************************************
- // ******************************* INITIALIZATION *********************************
- // ************************************************************************************
- int ledPin = 11; // sets which pin connects to LED Strip +5V
- int micInput = A0;
- // ************************************************************************************
- // ******************************* SETUP, RUNS ONCE *******************************
- // ************************************************************************************
- void setup()
- {
- Serial.begin(9600); // sets the data rate at which the Arduino runs in bits per second
- pinMode(ledPin, OUTPUT); // configures pin to behave as either input or output
- }
- // ************************************************************************************
- // ************************** LOOP, RUNS CONTINUOUSLY *****************************
- // ************************************************************************************
- void loop()
- {
- int voltsraw = analogRead(micInput);
- Serial.print("microphone voltage: ");
- Serial.println(voltsraw);
- digitalWrite(ledPin, HIGH);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement