Jump to content
Sign in to follow this  
raziehashim

analogRead showing incorrect reading

Recommended Posts

Hi,

So I simply wanted to try out my new CC3220SF using Energia. Unfortunately I noticed that I always get the wrong readings from the pin.  I used a voltage divider to ensure the voltage connected to the analog pin is no more than 1.3V.  For that I simply took three 1k Ohm resistors and put them in series then connect a parallel circuit from the last resistor to the potentiometer. I also have ensure that the jumper powering the opAmp to enable the ADC on board is populated.

I simply used the example code then changed the pin number. I also already have tested changing all the pin number but it all comes down to nothing.

But to simplify your work to help me, here's the code nonetheless,

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600); // msp430g2231 must use 4800
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin A3:
  int sensorValue = analogRead(A0); //I tried A0,A1,A2,A3 already
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1); // delay in between reads for stability
}

And here is my setup:

  • LaunchPad board name and version: CC3220S_LAUNCHXL (Rev-A)
  • Energia IDE version: 1.8.11E23
  • Board package version: 5.6.2
  • OS name and version: Windows 10

Thanks,

Razi Hashim

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...