Go Down

Topic: Colorduino HELP (Read 3099 times) previous topic - next topic

vahakn

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.

Code: [Select]
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:

http://blog.lincomatic.com/?p=148
http://www.instructables.com/id/Lampduino-an-8x8-RGB-Floor-Lamp/?ALLSTEPS

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:
Code: [Select]
Colorduino.SetPixel(x,y,r,g,b);

but am getting these errors:
Quote
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


Code: [Select]
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

Samuel10

#1
Feb 23, 2013, 04:13 am Last Edit: Feb 23, 2013, 04:48 am by Sam97 Reason: 1
Put it together where it looks like this.
Code: [Select]

#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.  
Code: [Select]

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

vahakn

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


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

Samuel10

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

Samuel10

By the way what arduino board are you using?

vahakn

#6
Feb 28, 2013, 12:12 pm Last Edit: Feb 28, 2013, 03:19 pm by vahakn Reason: 1
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:

Code: [Select]
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

Samuel10

Are there any free pins on the uno?

vahakn

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.

Code: [Select]
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

Samuel10

Try this.
Code: [Select]

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

}

Go Up