Jump to content
43oh

How to make enable adc 12bits and not default adc (MSP430) ?


Recommended Posts

Hello everyone, I have a problem with Energia and my MSP430F5529, this micro is enable to use 12bits ADC, but I can't find the way to make it enable that configuration because Energia runs my code in default 10bits ADC, some one can tell me how can I configure the ADC to use 12 bits resolution??, this is my code:
 

#include <Servo.h> 
 
Servo servo;   
 
int potpin = 23;  
int volt, i;        
 
void setup() 
  servo.attach(19);        
 
void loop() 
  volt=analogRead(potpin);
  i=volt/6;                                       //I'ms using 6, because 1023/6 = aprox ? 180 steps that I need. I want to use 4095/23  ? 180 steps
  servo.write(i);
  delay(100);

My code is working, but is working with 10bits resolution, and I need 12bits.Thanks for attention to my 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.

×
×
  • Create New...