Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Storage / HOW DO I STORE IN EEPROM longer BYTES on: September 16, 2014, 01:24:30 pm
How do I write some data in the EEPROM of Arduino which is an "uint_16" datatype say and it's values may range from  0 - 3000 say ?
2  Using Arduino / Motors, Mechanics, and Power / Re: Position recording through linear encoder and playback on an salvaged printer on: September 14, 2014, 06:29:40 pm
And My motor will oscillate - It doesn't have to stop.. And closed loop PID control does that. But I don't know how it will work here.. Help with the code logic at least here.. 
3  Using Arduino / Motors, Mechanics, and Power / Re: Position recording through linear encoder and playback on an salvaged printer on: September 14, 2014, 06:20:15 pm
Let me make it simple for all..
Say i have a list of predefined positions available.
23
33
45
36
57
67
78
52
47
30
12
.
.
.
etc etc.
coming from EEPROM  of Arduino as the loop goes on.
It is getting stored in a variable. ¨
Now is that possible to actuate the motor so that it approximately goes to those positions. 
Is there a simple way .
My earlier logic didn't work.
Tried out several other logics..

Here's the new code
(Didn't Work. the motor didn't move a  bit. But the data was coming out of eeprom swiftly..).

Here's the new code MarkT:

Code:
#include <EEPROM.h>

uint8_t recordButtonPin = 11;
uint8_t playButtonPin = 10;
//uint8_t ledPin = 13;

#define SAMPLE_DELAY 25

// Interrupt information
// 0 on pin 2
// 1 on pin 3
#define encoderI 2
#define encoderQ 3 // Only using one interrupt in this

volatile int count;

const int motorPinA = 12;
const int motorPinB = 13;

volatile int pos, newPos;
volatile int posrchd = 1;







void setup(){
  Serial.begin(115200);

  count=0;

  pinMode(encoderI, INPUT);
  pinMode(encoderQ, INPUT);
  attachInterrupt(0, handleEncoder, CHANGE);


  pinMode(recordButtonPin, INPUT);
  digitalWrite(recordButtonPin, HIGH);
  pinMode(playButtonPin, INPUT);
  digitalWrite(playButtonPin, HIGH);
  //pinMode(ledPin, OUTPUT);

  Serial.println("Linear Encoder recorder/player");

  pinMode(motorPinA, OUTPUT);
  pinMode(motorPinB, OUTPUT);

  digitalWrite(motorPinA, LOW);
  digitalWrite(motorPinB, LOW);
}







void loop(){
  // Serial.println(count);
  // delay(10);

  if (! digitalRead(recordButtonPin)) {
    delay(10);
    // wait for released
    while (! digitalRead(recordButtonPin));
    delay(20);
    // OK released!
    recordEncoder();
  }

  if (! digitalRead(playButtonPin)) {
    delay(10);
    // wait for released
    while (! digitalRead(playButtonPin));
    delay(20);
    // OK released!
    spitEncoder();
  }
}









void handleEncoder(){
  if(digitalRead(encoderI) == digitalRead(encoderQ))
  {
    count++;
  }
  else{
    count--;
  }
}









void recordEncoder(){
  uint16_t addr = 0;
  Serial.println("Recording Position");


  while (digitalRead(recordButtonPin)){
    Serial.print("Actual count: ");
    Serial.println(count);

 // Since EEPROM has trouble storing values in the range of 1XXX... (as the count ranges from 0 - 4000)
//I'm storing them as small range
// and later remap them in the range of 0 - 4000.
//those won't be accurate but I don't need precise controls.

    volatile int constrainedCount = constrain(count, 0, 4000);
    volatile int mappedCount = map(constrainedCount, 0, 4000, 0, 255);

    Serial.print("mapped count: ");
    Serial.println(mappedCount);

    EEPROM.write(addr, count);
    addr++;
    if (addr == 512) break;
    delay(SAMPLE_DELAY);
  }
  if (addr != 512) EEPROM.write(addr, 255);

  //digitalWrite(ledPin, LOW);

  Serial.println("Done Recording");
  delay(250);
  // return();
}







void spitEncoder(){
  uint16_t addr = 0;
  Serial.println("Spitting what you just recorded");

  while (digitalRead(playButtonPin)){
    volatile int x = EEPROM.read(addr);

    pos = map(x, 0, 255, 0, 4000);

    if (x == 255) break;
    Serial.print("dumped Val");
    Serial.println(x);
    Serial.print("Demapped(actually remapped) Val");
    Serial.println(pos);


    if(posrchd){              // position reached flag
      newPos = pos;
      posrchd = 0;
    }
    posrchd = go_to_target(newPos);

    delay(SAMPLE_DELAY);
    addr++;
    if (addr == 512) break;
  }
  //if (addr != 512) EEPROM.read(addr);
  Serial.println("Done Spitting");
  delay(250);
  //return();
}







volatile int go_to_target(volatile int target){
  int temp = 0;
  if(target < 3600 && target > 100){  // Boundary limit readings
    if(pos < target){
      moveForward();
      temp = 0;
    }
    else if(pos > target){
      moveBackward();
      temp = 0;
    }
    else temp = 1;
  }
  return temp;
}








void moveForward(){
  digitalWrite(motorPinA, HIGH);
  digitalWrite(motorPinB, LOW);
}

void moveBackward(){
  digitalWrite(motorPinA, LOW);
  digitalWrite(motorPinB, HIGH);
}


And MarkT  it would be helpful if you could help me with the closed Loop PID code for this case.
I guess the above code some how resembles a PID control loop 
4  Using Arduino / Motors, Mechanics, and Power / Re: Position recording through linear encoder and playback on an salvaged printer on: September 14, 2014, 01:05:34 pm
Hello There.
Nice to  hear that you are also trying something exciting.
Few notes on the discussion.
I don't think the motor have to ever stop as the values will always be changing. So the motor can be kept running to the positions.
By the way I'm going to try out the pseudo code today with out the
Code:
if(pos == old pos)

part  as I suspect the case will never arrive.

I'll log my findings here..

Wish me luck
5  Using Arduino / Motors, Mechanics, and Power / Position recording through linear encoder and playback on an salvaged printer on: September 13, 2014, 10:45:22 pm
Hello.
I recently salvaged an old printer and I was able to retrieve the bed for linear motion with an linear encoder, strip and a DC motor.
I was successful to jack in the encoder to Arduino and see the positions of the print head(When I moved it with my hands).
I than stored the position values in the EEPROM flash memory of Arduino with a button click and  replayed the position on the serial monitor with another button click.

What I want to do is move the print head by my hand and record the positions with the first button click and then after clicking the second button I want the print head to move automatically to the positions I moved it previously.

I do not want a very sophisticated PID control for it. I'm a tinkerer and want to start step by step. A help with code snippet for the part of motor control to go to targeted positions as recorded would be helpful.

The code till now I've written is
Code:

#include <EEPROM.h>

uint8_t recordButtonPin = 11;
uint8_t playButtonPin = 10;
//uint8_t ledPin = 13;

#define SAMPLE_DELAY 25

// Interrupt information
// 0 on pin 2
// 1 on pin 3
#define encoderI 2
#define encoderQ 3 // Only using one interrupt in this

volatile int count;

const int motorPinA = 12;
const int motorPinB = 13;



void setup(){
  Serial.begin(115200);

  count=0;

  pinMode(encoderI, INPUT);
  pinMode(encoderQ, INPUT);
  attachInterrupt(0, handleEncoder, CHANGE);


  pinMode(recordButtonPin, INPUT);
  digitalWrite(recordButtonPin, HIGH);
  pinMode(playButtonPin, INPUT);
  digitalWrite(playButtonPin, HIGH);
  //pinMode(ledPin, OUTPUT);

  Serial.println("Linear Encoder recorder/player");

  pinMode(motorPinA, OUTPUT);
  pinMode(motorPinB, OUTPUT);
}

void loop(){
  // Serial.println(count);
  // delay(10);

  if (! digitalRead(recordButtonPin)) {
    delay(10);
    // wait for released
    while (! digitalRead(recordButtonPin));
    delay(20);
    // OK released!
    recordEncoder();
  }

  if (! digitalRead(playButtonPin)) {
    delay(10);
    // wait for released
    while (! digitalRead(playButtonPin));
    delay(20);
    // OK released!
    spitEncoder();
  }
}




void handleEncoder(){
  if(digitalRead(encoderI) == digitalRead(encoderQ))
  {
    count++;
  }
  else{
    count--;
  }
}



void recordEncoder(){
  uint16_t addr = 0;
  Serial.println("Recording Position");


  while (digitalRead(recordButtonPin)){
    // Serial.print("Actual count: ");
    //Serial.println(count);

    volatile int constrainedCount = constrain(count, 0, 4000);
    volatile int mappedCount = map(constrainedCount, 0, 4000, 0, 255);

    Serial.print("mapped count: ");
    Serial.println(mappedCount);

    EEPROM.write(addr, mappedCount);
    addr++;
    if (addr == 512) break;
    delay(SAMPLE_DELAY);
  }
  if (addr != 512) EEPROM.write(addr, 255);

  //digitalWrite(ledPin, LOW);

  Serial.println("Done Recording");
  delay(250);
  // return();
}


void spitEncoder(){
  uint16_t addr = 0;
  Serial.println("Spitting what you just recorded");

  while (digitalRead(playButtonPin)){
    volatile int x = EEPROM.read(addr);


    if (x == 512) break;
    Serial.println(x);
    delay(SAMPLE_DELAY);
    addr++;
    if (addr == 512) break;
  }
  //if (addr != 512) EEPROM.read(addr);
  Serial.println("Done Spitting");
  delay(250);
  //return();
}

void moveForward(){
  digitalWrite(motorPinA, HIGH);
  digitalWrite(motorPinB, LOW);
}

void moveBackward(){
  digitalWrite(motorPinA, LOW);
  digitalWrite(motorPinB, HIGH);
}

   

I'm struggling with the logic for my next part of using the stored position data to control the DC motor simply and not with a Kp Ke etc etc PID equations ..

Advance bunch of thanks

Pseudo code :

Code:
if(pos != old pos){
if(pos>old pos){
move forward  // or backward
}
if(pos≤old pos){
move opposite direction
}
}
if(pos == old pos){
........
I don't know how to direct the motor for the next logged  position
........
}
6  Products / Arduino Yún / Yun cannot connect to network on: May 23, 2014, 06:47:11 am
Hello; I'm new to the networking and  recently I got myself a YUN.
After realizing some mistake I made(in setting password for my network) in the config page, I went to reset my yun.
After a successful reset, When I re-logged in that page, the drop-down list for discovering networks, shrinked and I couldn't select my network from there.
Although in the fill box just below that (where it was earlier getting refilled automatically after my selection from the previous dd list), now I wrote down the exact  network name.
After configuring and restarting, I couldn't access the page( http://********.local/ ) and shows "page cannot be displayed".
Also I cannot access it  through SSH or telnet..
through putty's serial terminal although I have the access..

Network traffic is not that high. Only 4 people in the apartment and mostly 2 computers activated at once.

I also tried multiple times restarting it, same problem persists.

Can anybody suggest what has happened and how can I enable the Yun to connect to my network.. ??

Any sort of help is appreciated..
7  Using Arduino / Networking, Protocols, and Devices / Xively wifi download on: November 21, 2013, 04:32:04 am
Hello. I've been recently trying to read an active feed of myself from xively using wifishield and Arduino.
When I broadcast the data I get returns as 200.  but when I download the data i get return <-1 in serial monitor.
 I used to upload simple photo-resistor reading to xively as test through my Ethernet shield which shows correct reading on xively and my serial monitor.
Also in the same code when I tried to download the feed from xively, it was able to read correctly as the return was correct 200 everytime.
But when I used another Arduino and a separate wifi shield for it to first connect to the same network and 2ndly to a different network, i get return values in serial monitor as <-1 and so no feed is downloaded.

Can you help me here? The examples are from the xively library itself.
8  Topics / Home Automation and Networked Objects / optical dust sensor data to xively on: November 14, 2013, 03:46:30 am
Hello.
Recently I bought myself an optical dust sensor and I hooked it up with my Arduino and then I tested the code. It was satisfactory after consulting it's wiki page:
Here is the link:
http://www.seeedstudio.com/wiki/Grove_-_Dust_sensor
Code is there in the wiki page to read the data in serial monitor.

Now I wanted  to upload the data to xively and so I used xively's Arduino Library. (https://github.com/xively/xively_arduino)

Looking at one of the "data-stream upload example", I modified my code in this way:

Code:
//for OLED********
#include <Wire.h>
#include <SeeedOLED.h>
#include <avr/pgmspace.h>
//*****************
#include <SPI.h>
#include <Ethernet.h>
#include <HttpClient.h>
#include <Xively.h>

//Assigning parameters for the dust sensor//same as the previous code
int pin = 8;
unsigned long duration;
unsigned long starttime;
unsigned long sampletime_ms = 30000;//sampe 30s ;
unsigned long lowpulseoccupancy = 0;
float ratio = 0;
int concentration = 0;

//Xively parameters**************

// MAC address for your Ethernet shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

char xivelyKey[] = "neZYOTXMfiqD9OJD3sYiasJdmX1X5DxzyzH2IuHmhk4SLFAH"; //this is my xively API Key

char sensorId[] = "Particle_Conc:";
XivelyDatastream datastreams[] = {
 XivelyDatastream(sensorId, strlen(sensorId), DATASTREAM_FLOAT),
};

// Finally, wrap the datastreams into a feed
XivelyFeed feed(1803940077, datastreams, 1); // my FEED ID is 1803940077 and single datastream

EthernetClient client;
XivelyClient xivelyclient(client);


void setup()
{
  Serial.begin(9600);
  
  Serial.println("Starting single datastream upload to Xively...");
  Serial.println();
  while (Ethernet.begin(mac) != 1)
  {
    Serial.println("Error getting IP address via DHCP, trying again...");
    delay(15000);
  }
  
// OLED stuff****************************
  //pinMode(CS_pin, OUTPUT);
  Wire.begin();
  SeeedOled.init();  //initialze SEEED OLED display
  DDRB|=0x21;        
  PORTB |= 0x21;
  SeeedOled.clearDisplay();          //clear the screen and set start position to top left corner
  SeeedOled.setNormalDisplay();      //Set display to normal mode (i.e non-inverse mode)
  SeeedOled.setPageMode();
  SeeedOled.drawBitmap(url,1024);   // 1024 = 128 Pixels * 64 Pixels / 8  //Set addressing mode to Page Mode
  SeeedOled.setTextXY(4, 10);          //Set the cursor to Xth Page, Yth Column  
  SeeedOled.putString("Hello"); //Print the String
  SeeedOled.setTextXY(6, 10);          //Set the cursor to Xth Page, Yth Column  
  SeeedOled.putString("Folks"); //Print the String
  delay(5000);
  SeeedOled.clearDisplay();
  SeeedOled.setTextXY(2, 4);
  SeeedOled.putString("Pollution");
  SeeedOled.setTextXY(4, 4);
  SeeedOled.putString("Recorder");
  delay(2000);
  SeeedOled.clearDisplay();
  SeeedOled.setTextXY(3, 0);
  SeeedOled.putString("Measuring...");
 // SeeedOled.setHorizontalScrollProperties(Scroll_Right,3,0,Scroll_5Frames); //Set Scrolling properties to Scroll Right
 // SeeedOled.deactivateScroll();             // Activate Scrolling
 
//OLED stuff finished**********************

// Dust sensor parameters*****************
  pinMode(8,INPUT);
  starttime = millis();//get the current time;
  //////******************
}

void loop()
{
//Dust sensor calculation thing********************

  duration = pulseIn(pin, LOW);
  lowpulseoccupancy = lowpulseoccupancy+duration;
  
  if ((millis()-starttime) > sampletime_ms)//if the sampel time == 30s
  {
    ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100
    concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve
  
    Serial.print("Lowpulseoccupancy: ");
    Serial.print(lowpulseoccupancy);
    Serial.println("Ratio: ");
    Serial.print(ratio);
    Serial.println("Conc.: ");
    Serial.print(concentration);
    Serial.println();
    
    lowpulseoccupancy = 0;
    starttime = millis();
    
//Xivly upload stuff happening here
    datastreams[0].setFloat(concentration);
    int ret = xivelyclient.put(feed, xivelyKey);
    Serial.println(ret);
    Serial.println();
 //   problem is here some where

    SeeedOled.clearDisplay();
    //SeeedOled.deactivateScroll();
    SeeedOled.setTextXY(0, 0);
    SeeedOled.putString("Dust Conc.");
    SeeedOled.setTextXY(2, 0);
    SeeedOled.putString("in pcs/283ml:");
    SeeedOled.setTextXY(4, 1);
    SeeedOled.putFloat(concentration);
   }
   delay(500);
  }

Now It's uploading data as expected after it's 30s sampling time, but the data's do not match. It's almost much lesser than the data I get using the previous code(Not implementing  xively alterations).

I'm confused if it has to do with delay or something?
It would be kind if any body out there can scan the code and tell me what's going wrong.
9  Using Arduino / Networking, Protocols, and Devices / Re: X-bee + Arduino prope - need proper buffer-less flow on: September 16, 2013, 03:28:00 pm
Forgot to attach the receiver plotter schematic
. Please look for the attachments


10  Using Arduino / Networking, Protocols, and Devices / X-bee + Arduino prope - need proper buffer-less flow on: September 16, 2013, 03:26:05 pm
Ola everyone!

Was just trying out something crazy and thought of showing carbon monoxide levels as pencil plots (Something like carbon rings on paper) by controlling the translation of a servo attached to a Arduino over  wireless x-bee network (See pic below for "Receiver plotter.png").
A MQ7 equipped with an LCD and X-bee on an Arduino will act as the sensor transmitter(Made it successfully and is working. See Pic below-"Transmitter sensor.png") .

The Anaglog voltages are well printed on the LCD(As indicative CO levels) and show the same data on X-CTU's terminal over wireless X-bee network.
(with a "." in fornt of each received data like . 123, .234 etc etc).

this is the Transmitter sensor code:
Code:
[/font][/size]

#include <LiquidCrystal.h>

int sensorValue;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
  Serial.begin(9600);
  lcd.begin(16, 2); 
}

void loop()
{
sensorPrintFunction();
}

void sensorPrintFunction()
{
  sensorValue = analogRead(0);       // read analog input pin 0
  Serial.println(sensorValue, DEC);  // prints the value read
  delay(100);                        // wait 100ms for next reading
 
  lcd.clear(); // Clear the display
  lcd.print("CO level:"); // Print some text
  lcd.setCursor(0,1);
  lcd.print(sensorValue);
  delay(200);
}

I'm receiving values ranging from 120-400(depending on environment I'm in currently).

The only concern is, the servo's not translating as fast with the data change and it even does not change at all sometimes in cases like when the value changes from say 164 - 175. I could just hear a noise from the servo and that's it. I'm using 9gms micro servos but tried with bigger ones also.
I need a noticeable and rapid  translations in the servo.

Here's the receiver end's code:

Code:
#include <Servo.h>

Servo myservo;
int x = 0;

void setup()
{
  Serial.begin(9600);
  myservo.attach(9);
}

void loop()
{
 
  while(Serial.available())
  {
    x = Serial.read()-'0';
    Serial.flush();
  }
  myservo.write(x);
  delay(5);
 
 }

Please Help me with the code.

What i'm guessing is may be
 1. Buffer problem-But I'm using "Serial.flush();"
 2. May be delay can have some effect. Not effected much I tried. (Have to try few more shots.)
 3. using "volatile byte" as datatype for the incoming serial data did not make much difference too. (Did not tried it sincerely though) .

Help me here anybody.
11  Community / Gigs and Collaborations / Re: Controlling RGB Leds from Live video feedback(Using processing) on: September 05, 2013, 04:59:41 am
This is the final code I came up with. But since I'm not having currently ant RGB LEDs with me(They are in shipment), I'm not able to test it.

Can anybody verify it and suggest where to rectify.

Notes: Processing is ending floats and Arduino is storing them as ints in the array. Hope that won't matter much.

Anyways here's the code.

Code:
//int counter = 0;
int redPin = A0;
int greenPin = A1;
int BluePin = A2;

int incomingdata[6];

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0)
  {
  incomingdata = Serial.read();
   
  analogWrite(redPin, incomingdata[0]);
  analogWrite(BluePin, incomingdata[2]);
  analogWrite(greenPin, incomingdata[4]);
}
}
12  Community / Gigs and Collaborations / Re: Controlling RGB Leds from Live video feedback(Using processing) on: September 05, 2013, 04:51:04 am
Hi.
Thanks for replying.
It would be a pleasure if you could tell me which data type to assign as the suffix to an array which contains both character and float .
I mean, my processing sketch is say writing these values in serial port at some instance.

23.00,34.00,54.00.

here 23.00, 34.00 and 54.00 are floats and "," is the character.

the respective chuck of processing code :
Code:
myPort.write(float r + "," + float g + ";" + float b + ".");


Now to assign an array and access from it would need

Code:
//for defining the variable
int incomingdata[16]; //say
 // or
char incomingdata[16];

And for accessing the data from the array and assigning it to something may be like this :

Code:
analogWrite(A2, incomingdata[10]);// writing say Pin A2 with the incoming value stored in 10th chamber of the array "incomingdata"

Now the questions are:

How can I Afford both "," and "floats" in the same array (Do I really need to do that)
and then how to convert floats in to integers ?
13  Community / Gigs and Collaborations / Re: Controlling RGB Leds from Live video feedback(Using processing) on: September 03, 2013, 02:50:35 am
That is where I'm stuck. I know parsing from strings and bytes in Processing but is a bit confuse in terms of Arduino. So I need the help in code.
14  Community / Gigs and Collaborations / Controlling RGB Leds from Live video feedback(Using processing) on: September 02, 2013, 07:55:03 am
Hello.
I'm trying to build a project where in a acrylic pillar will change it's color according to the ambiance.
Now to do that I've written (With taking some help) a program in Processing which would send serially the R G B values from the live camera video.
(The Processing sketch is attached below)
here's the snippet from the processing sketch which sends R G B Values to the serial port.
Code:
myPort.write(r + "," + g + "," + b + ".");
code:
Code:
import processing.video.*;
import processing.serial.*;
Serial myPort;
Capture video;
float m,r,g,b;
int loc;
boolean R = false;

PFont f;

void setup() {
  size(640,480);
  myPort = new Serial(this, "COM11", 9600);
  video = new Capture(this,width,height,15);
  f = createFont("Haettenschweiler",12);
}

void draw() {
  if (video.available()) {
    video.read();
  }
  image(video,0,0);
 
  for (int i = 0; i < video.width; i+=10) {
    for (int j = 0; j < video.height; j+=10) {
      loc = i + j * width;     

      color c = video.pixels[loc]; // Get a pixel   
     
      r = red(c);
      g = green(c);
      b = blue(c); // Get the red value

      m = map(i, 0, width-50,50, 100);
     
      stroke(255,0,0);
      point(m-40,-r/2+height-5);
     
      stroke(0,255,0);
      point(m+20,-g/2+height-5);
     
      stroke(0,0,255);
      point(m+80,-b/2+height-5);
    }
  }
 
  textSize(10);
  fill(255,0,0); 
  text(nf(r,2,0),200,height-60);
  fill(0,255,0); 
  text(nf(g,2,0),200,height-45);
  fill(0,0,255); 
  text(nf(b,2,0),200,height-30);
  myPort.write(r + "," + g + "," + b + ".");
  println(r + "," + g + "," + b);
}


Now I need an Arduino sketch which would utilize this received string to write, with PWM, the RGB LED's Pins Accordingly for according color settings.
I don't know where to start from extracting the string in the Arduino code.
I found a simple RGB control program on web which I'm attaching here(with a bit of my own twitching)

Code:
int redPin = 11;
int greenPin = 10;
int bluePin = 9;

void setup()
{
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT); 
 
  Serial.begin(9600);
}

void loop()
{
  setColor(255, 0, 0);  // red
  delay(1000);
  setColor(0, 255, 0);  // green
  delay(1000);
  setColor(0, 0, 255);  // blue
  delay(1000);
  setColor(255, 255, 0);  // yellow
  delay(1000); 
  setColor(80, 0, 80);  // purple
  delay(1000);
  setColor(0, 255, 255);  // aqua
  delay(1000);
}

void setColor(int red, int green, int blue)
{
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue); 
}

void serialEvent() {
  while (Serial.available())
 {
//from here on I need some help
...
}

I got this reply here :

http://forum.arduino.cc/index.php?topic=185841.new;topicseen#new

Can anybody help me here?
15  Using Arduino / Programming Questions / Re: Controlling RGB Leds from Live video feedback(Using processing) on: September 02, 2013, 07:34:10 am
guys!! sorry to say so but this started sounding all alien to me. You see I'm not so regular with Arduino. So if any of you can please edit the code it would be a lot of help for me.   smiley-sweat
Pages: [1] 2 3 ... 6