SHARE
TWEET

MusicWaveGeneratorArduino

a guest May 25th, 2016 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //this will be our analog value for the audio input
  2. int audVal;
  3.  
  4. //this is the analog pin we are reading values from (0 is A0)
  5. const int audPin = 0;
  6.  
  7. void setup() {
  8.   // put your setup code here, to run once:
  9.  
  10.   //let's establish communication with all of
  11.   //our computer programs on the 9600 "channel"
  12.   Serial.begin(9600);
  13. }
  14.  
  15. void loop() {
  16.   // put your main code here, to run repeatedly:
  17.  
  18.   //set audVal equal to the analog value from audPin
  19.   audVal = analogRead(audPin);
  20.  
  21.   //let's tell the computer programs the audio value from audPin
  22.   Serial.println(audVal);  
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top