Hi i am new to the 4d system products, been using arduino for a while. I am having issue uploading this sketch on 4d workshop to gen-iod-32. I am getting rc=1. I am trying to get different fastled sketching running off a button.
it uploads fine until i put this line off code in, FastLED.addLeds"WS2812B, DATA_PIN, RGB"(leds, NUM_LEDS);
#include "ESP8266WiFi.h"
#include "GFX4d.h"
#include "FastLED.h"
GFX4d gfx = GFX4d();
#include "ButtonsConst.h" // Note. This file will not be created if there are no generated graphics
#define NUM_LEDS 1
int state;
CRGB leds[NUM_LEDS];
void setup()
{
gfx.begin();
gfx.Cls();
gfx.ScrollEnable(false);
gfx.BacklightOn(true);
gfx.Orientation(PORTRAIT);
gfx.SmoothScrollSpeed(5);
gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1);
gfx.Open4dGFX("BUTTON~1"); // Opens DAT and GCI files for read using filename without extension. Note! Workshop generates files with Short filenames
gfx.imageTouchEnable(iWinbutton1, true) ; // Winbutton1 show initialy, if required
gfx.UserImages(iWinbutton1,0) ; // Winbutton1 show initialy, if required
gfx.imageTouchEnable(iWinbutton2, true) ; // Winbutton2 show initialy, if required
gfx.UserImages(iWinbutton2,0) ; // Winbutton2 show initialy, if required
gfx.imageTouchEnable(iWinbutton3, true) ; // Winbutton3 show initialy, if required
gfx.UserImages(iWinbutton3,0) ; // Winbutton3 show initialy, if required
FastLED.addLeds"WS2812B, DATA_PIN, RGB"(leds, NUM_LEDS);
} // end Setup **do not alter, remove or duplicate this line**
void loop()
{
gfx.touch_Update();
state = gfx.touch_GetPen();
if(state == TOUCH_PRESSED){
if(gfx.imageTouched() == iWinbutton1){
gfx.UserImages(iWinbutton1, 1);
}
if(gfx.imageTouched() == iWinbutton2){
gfx.UserImages(iWinbutton2, 1);
}
if(gfx.imageTouched() == iWinbutton3){
gfx.UserImages(iWinbutton3, 1);
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
//do something
}
}
if(state == TOUCH_RELEASED){
gfx.UserImages(iWinbutton1, 0); // Winbutton1 where state is 0 for up and 1 for down
gfx.UserImages(iWinbutton2, 0); // Winbutton2 where state is 0 for up and 1 for down
gfx.UserImages(iWinbutton3, 0); // Winbutton3 where state is 0 for up and 1 for down
}
// put your main code here, to run repeatedly:
yield(); // Required for ESP
}
it uploads fine until i put this line off code in, FastLED.addLeds"WS2812B, DATA_PIN, RGB"(leds, NUM_LEDS);
#include "ESP8266WiFi.h"
#include "GFX4d.h"
#include "FastLED.h"
GFX4d gfx = GFX4d();
#include "ButtonsConst.h" // Note. This file will not be created if there are no generated graphics
#define NUM_LEDS 1
int state;
CRGB leds[NUM_LEDS];
void setup()
{
gfx.begin();
gfx.Cls();
gfx.ScrollEnable(false);
gfx.BacklightOn(true);
gfx.Orientation(PORTRAIT);
gfx.SmoothScrollSpeed(5);
gfx.TextColor(WHITE, BLACK); gfx.Font(2); gfx.TextSize(1);
gfx.Open4dGFX("BUTTON~1"); // Opens DAT and GCI files for read using filename without extension. Note! Workshop generates files with Short filenames
gfx.imageTouchEnable(iWinbutton1, true) ; // Winbutton1 show initialy, if required
gfx.UserImages(iWinbutton1,0) ; // Winbutton1 show initialy, if required
gfx.imageTouchEnable(iWinbutton2, true) ; // Winbutton2 show initialy, if required
gfx.UserImages(iWinbutton2,0) ; // Winbutton2 show initialy, if required
gfx.imageTouchEnable(iWinbutton3, true) ; // Winbutton3 show initialy, if required
gfx.UserImages(iWinbutton3,0) ; // Winbutton3 show initialy, if required
FastLED.addLeds"WS2812B, DATA_PIN, RGB"(leds, NUM_LEDS);
} // end Setup **do not alter, remove or duplicate this line**
void loop()
{
gfx.touch_Update();
state = gfx.touch_GetPen();
if(state == TOUCH_PRESSED){
if(gfx.imageTouched() == iWinbutton1){
gfx.UserImages(iWinbutton1, 1);
}
if(gfx.imageTouched() == iWinbutton2){
gfx.UserImages(iWinbutton2, 1);
}
if(gfx.imageTouched() == iWinbutton3){
gfx.UserImages(iWinbutton3, 1);
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
//do something
}
}
if(state == TOUCH_RELEASED){
gfx.UserImages(iWinbutton1, 0); // Winbutton1 where state is 0 for up and 1 for down
gfx.UserImages(iWinbutton2, 0); // Winbutton2 where state is 0 for up and 1 for down
gfx.UserImages(iWinbutton3, 0); // Winbutton3 where state is 0 for up and 1 for down
}
// put your main code here, to run repeatedly:
yield(); // Required for ESP
}
Comment