'Color Value From:' block notworking
Automaxion
Posts: 26
Can anyone solve this problem?
I am using BlocklyProp Solo with a Propellor FLiP board. I re-installed BlocklyProp Launcher (BPL) so I assume the libraries are up to date (no way of knowing as the BPL has no version shown). My OLED is working with other blocks. I tried a simple program shown in .png file.
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
I am using BlocklyProp Solo with a Propellor FLiP board. I re-installed BlocklyProp Launcher (BPL) so I assume the libraries are up to date (no way of knowing as the BPL has no version shown). My OLED is working with other blocks. I tried a simple program shown in .png file.
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
Comments
As I think you spotted, this line has incorrect parameters : fillRect(oledc, 0, 0, 96, 63, remapColor(0x NaN, "8R8G8B", "5R6G5B"));
Would you be able to attach the svg file of the blockly code to this thread, or email it to support@parallax.com if you cannot share publicly?
With the svg the problem could be diagnosed really fast, and probably there will be a quick workaround whilst any fixes are implemented.
As for the code versions, the online blockly compiler is always up-to-date. The launcher can be updated sometimes to help with serial port issues, but that wouldn't impact the code compiler.
There was an update to launcher in the last couple days.... v0.11.2 is the latest as of today.
Yes I guessed the NaN was the problem (now I know it means 'not a number'. Call me ignorant: what is the svg please and where do I find it? How do I know what launcher I have and where are the latest versions downloadable. I did reinstall the launcher yesterday from (https://www.parallax.com/downloads/propeller-p8x32a-software) which is dated Jan 2020: annoyingly, the launcher screen does not have a version shown or any means to update.
Jim,
Thank-you. I did a lot more complex things to make a colour fade from one to another and was frustrated when I could not get it to compile and thought it was me. I am looking forward to a solution.
Cheers both,
Steve
We should be able to get to the NaN issue early this next week. There isn't a lot that can go wrong there.
Ah, OK. I see the version number. Mine is v0.11.0 running on Windows 10.
Thanks,
Steve
So for now it is a work around. How often do updates get issued?
Steve
//
Libraries and Definitions
#include "simpletools.h"
#include "colormath.h"
#include "ssd1331.h"
//
Global Variables and Objects
screen *oledc;
int item;
//
Main Program
int main() {
oledc = ssd1331_init(17, 6, 5, 3, 2, 96, 64);
item = (getColorRRGGBB(50, 50, 50));
fillRect(oledc, 0, 0, 96, 63, remapColor(0x NaN, "8R8G8B", "5R6G5B"));
}
As for update frequency, we try to push up new code every week when we are actively developing. The COVID-19 pandemic broke our stride but we're finally able to release more frequently again.