Jump to content

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
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.

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...