Hi everyone . i am vigneshraja. here i done the varying the color depending upon the analog value read from 10 k potentiometer using MSP430G2231. i am using Energia software for serial communication program. for varying the color of window i am using Processing software.

Step 1: Circuit Connection of 10k Potentiometer With Msp430 Launchpad

Step 2: Coding With Energia Software

The program code for energia to read 10k potentiometer

void setup()


Serial.begin(4800); // start serial communication


void loop()


int value = map(analogRead(A0), 0, 1023, 0, 255); //read value of pod and convert to 8 bit variation

Serial.println(value); // print the read value in serial monitor


for download energia software visit the link bellow:


Step 3: Coding With Processing Software

The code for processing software to change the color
according to the pod value:

import processing.serial.*;

Serial port;

float brightness = 0;

void setup()



port = new Serial(this, "COM4", 4800); // select the COM port shown bellow in the energia IDE port.bufferUntil('\n');


void draw()




void serialEvent (Serial port)


brightness = float(port.readStringUntil('\n'));


for download Processing software visit the link bellow:


Thank you for watching

Keep those MSP43P tutorials coming!!

About This Instructable




More by vigneshraja:Speed control of dc motor from laptop using arduino and processing Program Arduino Pro Mini Using Arduino Uno Touch switch for MSP430 launchpad 
Add instructable to: