Jump to content
Sign in to follow this  
alexisfire02

PWM from ADC joystick

Recommended Posts

Hello, I am trying to control the brightness of an LED by setting a PWM with a ADC joystick.  It can go up or right, to increase brightness, and it can go left or down to control brightness.  I can set it to work if I just read up and down, or just read left and right.  But I can't figure out how to control the ADC10 control registers to read both x and y values from the joystick.  

 

//#include <msp430.h>
#include <msp430g2553.h>
 
/*
 * main.c
 */
 
void main(void)
{
//int adcValue;
    WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
 
 
 
    //This is ADC10 control register
    //4th bit turns on ADC
    //11 and 12 sets  "16

Share this post


Link to post
Share on other sites


//#include <msp430.h>

#include <msp430g2553.h>

 

/*

* main.c

*/

 

void main(void)

{

//int adcValue;

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

 

 

 

//This is ADC10 control register

//4th bit turns on ADC

//11 and 12 sets "16

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×