Pages: [1]   Go Down
Author Topic: Colorduino HELP  (Read 2212 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
Interface Design Currently
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
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:
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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put it together where it looks like this.
Code:
#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:
#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.
« Last Edit: February 22, 2013, 10:48:44 pm by Sam97 » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
Interface Design Currently
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
Interface Design Currently
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

By the way what arduino board are you using?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
Interface Design Currently
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
« Last Edit: February 28, 2013, 09:19:07 am by vahakn » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are there any free pins on the uno?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
Interface Design Currently
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* dia.png (17.54 KB, 781x324 - viewed 93 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 48
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try this.
Code:
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

}
Logged

Pages: [1]   Go Up
Jump to: