Documentation for COLOR class


#1

I’m trying to use COLOR objects just like in the example in the ledstrip section, but I cant get it to work.

COLOR red(255,0,0);
//COLOR* red = new COLOR(255,0,0);

Neither lines of code will compile. I get error: new initializer expression list treated as compound expression [-fpermissive]. It seems to not like the (255, 0, 0). Is there more documentation on the COLOR class, because it’s hard to debug with the little information provided. Ultimately I’m trying to fill an array with COLOR objects so the color of the blade can be cycled with a momentary push button using a rising interrupt.


#2

Hi @Ryan_Pelo,

I have launched the IDE with an empty project, instanced a couple of COLOR classes and compiled just fine:

COLOR color(255,0,0);

void setup() {
  // put your setup code here, to run once:
  COLOR* c = new COLOR(255,0,0);
}

void loop() {
  // put your main code here, to run repeatedly:
}

Are you using version 1.0.3 core files?

The COLOR class implementation can be found here: https://github.com/Artekit/propboard-core/blob/master/cores/propboard/bitmap.h

Have you tried PBSaber? It does that and more.


#3

Thanks for the response and sorry for such a late reply. I suspect it is an error within my Arduino IDE, which I need to update. And I was also using V1.0.2 of the core files because 1.0.3 wouldn’t download for me. It was having trouble grabbing it from the URL. I will have to figure that out on my own.

On another note, what is the max current you can draw from a GPIO pin? What about the 3.3v pin?


#4

Hello @Ryan_Pelo,

If you are having problems installing v1.0.3 check this answer (the part related to installation problems): Artekit lightsaber

Regarding the GPIO pins, I would say no more than 8mA. Straight from the datasheet:

In this section of the manual you can find the pinout and also (below the table) how much current you can source/drain from the 3.3V pin.


#5

The extract up here is from the datasheet of the STM32. There is no datasheet for the board, but the manual.