Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Read analog voltage with

$
0
0

Hi

 

I bougth this one year ago:

 

launchpad-tivac-01.jpg

 

 

Today, i'm triying to read one analog voltaje, conecting the 3.3V pin or 5V pin to another

 

this is my code, it's very simple, but it doent work

 

 

int sensor = 5; //pin 5, el PE4
float voltaje = 0;

void setup() {

//declaro que el pin de la entrada analogica será de lectura
pinMode(sensor, INPUT);
Serial.begin(9600); //opens serial port, sets data rate to 9600 bps
}

void loop() {

voltaje = analogRead(sensor);

Serial.println (voltaje);
delay(2000);
}

 

What can I do to read the real analog voltage? Because the "Serial Monitor" in energía doesnt write me the correct value of the voltage

 

 

thank you and sorry for my English


Viewing all articles
Browse latest Browse all 2077

Trending Articles