Colorduino HELP

Hi there
I'm wondering if anyone can help me with colorduino programming. Its for a feedback display for a musical instrument interface for the severely disabled.

I've got the colorduino, hooked up, managed to (finally) run Lincomatic's Plasma demo.
I've also managed to program my own (very simple) solid color sequence with delays.

void loop()
{
  ColorFill(valr,valg,valb);
  
  valr=valr+1;
  valg=valg+2;
  valb=valb+10;

   delay(100); 
}

But now i'm totally stuck as there isn't a simpletons guide to Lincomatic's colorduino library.
I have read these two resources pretty thoroughly and am a bit lost:

I'd like to be able to address separate pixels. Make pixels move about and change colour according to values from potentiometers and other input sensors.

I've tried to get a handle around these code parts:

Colorduino.SetPixel(x,y,r,g,b);

but am getting these errors:

sketch_feb20a.cpp: In function 'void loop()':
sketch_feb20a:19: error: 'x' was not declared in this scope
sketch_feb20a:19: error: 'y' was not declared in this scope
sketch_feb20a:19: error: 'r' was not declared in this scope
sketch_feb20a:19: error: 'g' was not declared in this scope
sketch_feb20a:19: error: 'b' was not declared in this scope

PixelRGB *p = GetPixel(0,1);
for (int x=0;x < ColorduinoScreenWidth;x++) {
p->r = red;
p->g = green;
p->b = blue;
p++;
}

Essentially I'm not sure how to use the code properly.
If anyone could post some example code and maybe a brief explanation on the basics of how to implement it I'd be super grateful.
Its for a musical instrument interface for the severely disabled.

thanks

Vahakn

Put it together where it looks like this.

#include <Colorduino.h>

void loop()
{
  ColorFill(valr,valg,valb);
  //Uncomment the line below if your still having problems.
  //ColorFill(0,0,20);
  
  valr=valr+1;
  valg=valg+2;
  valb=valb+10;

   delay(100); 
}

When something isn’t declared your asking for a value or number that has not been set. I am just assuming the undeclared error is because you didn't include the proper libraries.

#include <stdio.h>
main()
{
int x = 10; // x is declared as 10
printf("X's value is %d",x);// It prints the value of X
getchar();
}

If you have a C compiler the example above should work. The same concept applies to the Arduino IDE although the example I put together above wont compile on the Arduino IDE.

Hi
Thanks for your reply!

My colorfill code is / was working fine.
Its the general assignment of pixels I want to harness.

I did indeed include the Colorduino Library.
And I dont know what a C compiler is.

Is it possible to use Colorduino alongside arduino running a code?
I wanted to control LED position and color with sensor paramaters.

Thanks

Vahakn

Hello!

Ive managed to get the SetPixel code to work (in a way).
Im ham-fistedly trying to make the thing go bananas with bad mathematics.

I have some questions.

  1. Can I use the Colorduino alongside an Arduino to control the LED matrix according to data from sensors.
    a) one major concern is that, for the program I want to run in paralel, I need the serial comm pins on the arduino for MIDI output.

Thank again for all your help

So your trying to control it with your computer or use buttons?

By the way what arduino board are you using?

Thanks for ur reply

im using an UNO.

I already have all these sensors working in a different patch and hooked up to an arduino.
I want the following in/output direct to Arduino (no computer):

INPUT:
Pot1
Pot2
Breath sensor
Bite sensor1
Bite sensor2
Mic (as a noise sensor - to generate a voltage - not working yet)

OUTPUT:
Midi Out
Colorduino

Ive recently tried the code below, but the serial read only says 0 and it doesnt seem to be listening to the Analog Pin:

void loop()
{
  
potVal = analogRead(potPin);   // read Pot pin
Serial.println(potVal, DEC);

vt = 100; // set refresh time
vy = 0; // set y coordiante 0-7
vx = 0; // set x coordiante 0-7
vr = 0; // set red value 0-255
vg = 0; // set green value 0-255
vb = potVal; // get blue value from potentiometer 0-255 (set to 255 for debug)

Colorduino.SetPixel(vx,vy,vr,vg,vb); // set the pixel data 
Colorduino.FlipPage(); // set data from display buffer
delay(vt); // delay

}

thanks

Are there any free pins on the uno?

yes. Most of them.
This is my current setup diagram:
[see attached image]

This the most recent experiment with 1 pot coming into the arduino.
I dont think the code is being uploaded to the arduino. I think it is going to the Colorduino.

void loop()
{
  
potVal = analogRead(potPin);   // read Pot pin
Serial.println(potVal, DEC);

vt = 100; // set refresh time
vy = 0; // y coordiante 0-7
vx = 0; // y coordiante 0-7
vr = 0; // set red value 0-255
vg = 0; // set green value 0-255
vb = potVal; // get blue value from potentiometer 0-255 (set to 255 for debug)

Colorduino.SetPixel(vx,vy,vr,vg,vb); // set the pixel data 
Colorduino.FlipPage(); // set data from display buffer
delay(vt); // delay

}

thanks

Try this.

void loop()
{
  
potVal = analogRead(potPin);   // read Pot pin
Serial.println(potVal, DEC);

vt = 100; // set refresh time
vy = 0; // y coordiante 0-7
vx = 0; // y coordiante 0-7
vr = 100; // set red value 0-255
vg = 0; // set green value 0-255
vb = potVal; // get blue value from potentiometer 0-255 (set to 255 for debug)

Colorduino.SetPixel(vx,vy,vr,vg,vb); // set the pixel data 
Colorduino.FlipPage(); // set data from display buffer
delay(vt); // delay

}