hello… here is the code i oftenly use to check out my sensors
maxsonar sensor give me from 0 to 1023 readings
/* Analog input, serial output
Reads an analog input pin, prints the results to the serial monitor.
The circuit:
* potentiometer connected to analog pin 0. Center pin of the potentiometer goes to the analog pin. side pins of the potentiometer go to +5V and ground
created over and over again by Tom Igoe and everyone who’s ever used Arduino
*/
void setup() { Serial.begin(9600); }
void loop() { // read the analog input into a variable: int analogValue = analogRead(0); // print the result: Serial.println(analogValue); // wait 10 milliseconds for the analog-to-digital converter // to settle after the last reading: delay(10); }
it did’n’t work with arduino mini pro (5 volt version )
but when i hooked up everything to my 3.3 volts version (raw voltage input) a big cloud of smokes came up and everyting is curently working just fine i now get very good analog values
maxsonar sensor give me from 0 to 1023 in analog readings equivalent to 0.5 inche per digit so i divided the result by 2 so the result is inches
but i still don<t know what is up with my 5 volt version???
i am almost new to all this stuff (voltage regulators , arduino pro)
This may be stupid, but does This may be stupid, but does your baud on the serial monitor match the 9600 baud in the code? Normally if it isnt then you get weird "drawings" and not actual data.