Advertisement
Guest User

MusicWaveGeneratorArduino

a guest
May 25th, 2016
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement