I need to have a potentiometer that controls a buzzer directly and I need to have it output the bits in two ways, numerically (like 250) and then also binary (0000 1000). While there are numerous codes online about getting the numerical number to consistently pop up on a loop, I haven't found a way to get binary to show up. If anyone could do that, that would be lovely!
//Analog Read with Serial Monitor
#include "pitches.h"
int notes[] ={
NOTE_B0,NOTE_C1,NOTE_D1,NOTE_E1,NOTE_F1,NOTE_G1,NOTE_A1,
NOTE_B1,NOTE_C2,NOTE_D2,NOTE_E2,NOTE_F2,NOTE_G2,NOTE_A2,
NOTE_B2,NOTE_C3,NOTE_D3,NOTE_E3,NOTE_F3,NOTE_G3,NOTE_A3};
int Tone = 0;
int buzzerPin = 2;
void setup() {
//the setup routine runs once when you press reset
Serial.begin(9600); //initialize serial communication at 9600 bits per second
}
void loop() {
//the loop routine runs over and over again forever
int sensorValue = analogRead(A0); //read the input on analog pin 0
int pitch = sensorValue/49;
tone(buzzerPin, notes[pitch], 100);
Serial.println(sensorValue); //print out the value you read
delay(100); //delay in between reads for stability
}
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you post you code that you have please?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Can you please tell us your electronics, programming, Arduino, hardware experience?
This will help us give you some accurate help.
Thanks.. Tom... 
I updated it with the code
Delta_G:
OK, can you clarify the question a little? What do you want that you don't have? Does the code in the first reply not help?
It worked. Thank you guys. I want to apologize for being such a rookie to the subject. I'm an ME with this one ECE class.
Hi,
Please do not go and update previous posts.
If you are posting code, do it in a new post, this keeps the flow of the thread understandable for others that may use it later to fix their problems.
Tom... 
Delta_G:
Yeah, sensorValue in your code doen't have a space in it. AND it has a capital V.
How is it supposed to be? I'm sorry, my coding is rough as this isn't my subject matter!
I appreciate all the help
Do not cross-post. Other thread removed.
Delta_G:
?????
You had a line that said Serial.print(sensor value, BIN)
But in your code you have a variable called sensorValue.
sensorValue and sensor value are not the same.
That doesn't require any sense at being able to write code to spot.
Oh that, yeah I caught and corrected that! Thanks thou!