Example Program - RGB Values
borellogio
Posts: 2
Hi,
http://learn.parallax.com/tutorials/language/blocklyprop/oled-display-blocklyprop/using-rgb-color-values
OLED draw rectangle at (X) 10
(y) 10
width 70
height 40
roundnes 0
color color valur from:
this block don't work,
I get the error message
Compile... Failed!
compiler messages
Included libraries: colormath, simpletools, ssd1331
single.c: In function 'main':
single.c:35:48: error: invalid suffix "x" on integer constant
single.c:35:51: error: expected ')' before 'NaN'
single.c:35:51: error: too few arguments to function 'remapColor'
/opt/parallax/Workspace/Learn/Simple Libraries/Utility/libcolormath/colormath.h:86:5: note: declared here
is it a library problem?
how do i insert them?
thank you and greetings
http://learn.parallax.com/tutorials/language/blocklyprop/oled-display-blocklyprop/using-rgb-color-values
OLED draw rectangle at (X) 10
(y) 10
width 70
height 40
roundnes 0
color color valur from:
this block don't work,
I get the error message
Compile... Failed!
compiler messages
Included libraries: colormath, simpletools, ssd1331
single.c: In function 'main':
single.c:35:48: error: invalid suffix "x" on integer constant
single.c:35:51: error: expected ')' before 'NaN'
single.c:35:51: error: too few arguments to function 'remapColor'
/opt/parallax/Workspace/Learn/Simple Libraries/Utility/libcolormath/colormath.h:86:5: note: declared here
is it a library problem?
how do i insert them?
thank you and greetings
Comments
Are you using BlocklyProp or BlocklySolo? Are all you libraries up to date?
What board are you selecting?
I ams using Blocklyprop, board is Propeller activity board, original, not WX.
how do i know if the libraries are up to date?
Best regards.
Basically, the 'color value from' block does not work since if I change it to a 'Color [x]' where [x] is a square of actual color, it works and draws a square of the selected [x] color.
The code is shown as being:
//
Libraries and Definitions
#include "simpletools.h"
#include "ssd1331.h"
#include "colormath.h"
//
Global Variables and Objects
screen *oledc;
//
Main Program
int main() {
oledc = ssd1331_init(17, 6, 5, 3, 2, 96, 64);
fillRect(oledc, 0, 0, 96, 63, remapColor(0x NaN, "8R8G8B", "5R6G5B"));
}
When I tried to compile it I get:
Compile... Failed!
compiler messages
Included libraries: ssd1331, simpletools, colormath
single.c: In function 'main':
single.c:14:44: error: invalid suffix "x" on integer constant
single.c:14:47: error: expected ')' before 'NaN'
single.c:14:47: error: too few arguments to function 'remapColor'
/opt/parallax/simple-libraries/Learn/Simple Libraries/Utility/libcolormath/colormath.h:86:5: note: declared here
undefined