Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

issue Arduino sketch #91

Open
lucavanthiel opened this issue Jul 19, 2018 · 5 comments
Open

issue Arduino sketch #91

lucavanthiel opened this issue Jul 19, 2018 · 5 comments

Comments

@lucavanthiel
Copy link

i have a issue with the Arduino sketch,
at "/**************************** START STRIPLED PALETTE *****************************************/"

Arduino: 1.8.5 (Mac OS X), Board:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

sketch________1__ledvoor:972: error: variable or field 'setupStripedPalette' declared void
void setupStripedPalette( CRGB A, CRGB AB, CRGB B, CRGB BA) {
^
sketch________1__ledvoor:972: error: 'CRGB' was not declared in this scope
sketch________1__ledvoor:972: error: 'CRGB' was not declared in this scope
void setupStripedPalette( CRGB A, CRGB AB, CRGB B, CRGB BA) {
^
sketch________1__ledvoor:972: error: 'CRGB' was not declared in this scope
void setupStripedPalette( CRGB A, CRGB AB, CRGB B, CRGB BA) {
^
sketch________1__ledvoor:972: error: 'CRGB' was not declared in this scope
void setupStripedPalette( CRGB A, CRGB AB, CRGB B, CRGB BA) {
^
sketch________1__ledvoor:1032: error: variable or field 'addGlitter' declared void
void addGlitter( fract8 chanceOfGlitter)
^
sketch________1__ledvoor:1032: error: 'fract8' was not declared in this scope
sketch________1__ledvoor:1042: error: variable or field 'addGlitterColor' declared void
void addGlitterColor( fract8 chanceOfGlitter, int red, int green, int blue)
^
sketch________1__ledvoor:1042: error: 'fract8' was not declared in this scope
sketch________1__ledvoor:1042: error: expected primary-expression before 'int'
void addGlitterColor( fract8 chanceOfGlitter, int red, int green, int blue)
^
sketch________1__ledvoor:1042: error: expected primary-expression before 'int'
void addGlitterColor( fract8 chanceOfGlitter, int red, int green, int blue)
^
sketch________1__ledvoor:1042: error: expected primary-expression before 'int'
void addGlitterColor( fract8 chanceOfGlitter, int red, int green, int blue)
^
In file included from /Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:36:0:
/Users/luca/Documents/Arduino/libraries/FastLED/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.007

pragma message "FastLED version 3.001.007"

                 ^

In file included from /Users/luca/Documents/Arduino/libraries/FastLED/FastLED.h:68:0,
from /Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:36:
/Users/luca/Documents/Arduino/libraries/FastLED/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"

                   ^

/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino: In function 'void setup()':
sketch________1__ledvoor:190: error: redefinition of 'void setup()'
void setup() {
^
sketch________1__ledvoor:1: error: 'void setup()' previously defined here
void setup() {
^
sketch________1__ledvoor:194: error: 'setupStripedPalette' was not declared in this scope
setupStripedPalette( CRGB::Red, CRGB::Red, CRGB::White, CRGB::White); //for CANDY CANE
^
/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino: In function 'bool processJson(char*)':
sketch________1__ledvoor:319: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
^
/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:319:3: note: suggested alternative:
In file included from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:10,
from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
from /Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:32:
/Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
sketch________1__ledvoor:319: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
^
sketch________1__ledvoor:323: error: 'class ArduinoJson::JsonObject' has no member named 'success'
if (!root.success()) {
^
sketch________1__ledvoor:398: error: 'MILLION' was not declared in this scope
unsigned int kelvin = MILLION / color_temp;
^
/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino: In function 'void sendState()':
sketch________1__ledvoor:430: error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
^
/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:430:3: note: suggested alternative:
In file included from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/StaticJsonDocument.hpp:8:0,
from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:10,
from /Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
from /Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino:32:
/Users/luca/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson/Memory/StaticJsonBuffer.hpp:110:7: note: 'ArduinoJson::Internals::StaticJsonBuffer'
class StaticJsonBuffer : public Internals::StaticJsonBufferBase {
^
sketch________1__ledvoor:430: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
^
sketch________1__ledvoor:435: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject&' from an rvalue of type 'ArduinoJson::JsonObject'
JsonObject& color = root.createNestedObject("color");
^
sketch________1__ledvoor:444: error: 'class ArduinoJson::JsonObject' has no member named 'measureLength'
char buffer[root.measureLength() + 1];
^
sketch________1__ledvoor:445: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
root.printTo(buffer, sizeof(buffer));
^
sketch________1__ledvoor:445: error: 'buffer' was not declared in this scope
root.printTo(buffer, sizeof(buffer));
^
/Users/luca/Documents/Arduino/sketch________1__ledvoor/sketch________1__ledvoor.ino: In function 'void loop()':
sketch________1__ledvoor:497: error: redefinition of 'void loop()'
void loop() {
^
sketch________1__ledvoor:6: error: 'void loop()' previously defined here
void loop() {
^
sketch________1__ledvoor:619: error: 'addGlitterColor' was not declared in this scope
addGlitterColor(80, realRed, realGreen, realBlue);
^
sketch________1__ledvoor:729: error: 'addGlitter' was not declared in this scope
addGlitter(80);
^
exit status 1
variable or field 'setupStripedPalette' declared void


please help, does anyone know something?

@Joeboyc2
Copy link

hey, are you using the arduinoIDE to do the upload or something else, like platformio?

@lucavanthiel
Copy link
Author

The arduino ide

@Joeboyc2
Copy link

can you upload you full sketch, looking at the errors above it says the void setup() has been redeclared

maybe if you copy and pasted you did it twice in the same sketch.....

Might be worth just downloading the original sketch again and attempting to upload that, it wont work for your setup, but at least you will know if the sketch is the issue, or your modifications

@zuidwijk
Copy link

zuidwijk commented Sep 26, 2018

I think it has to do with the arduino or libraries... I've got the same kind of error message:
error: 'StaticJsonBuffer' was not declared in this scope
StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;

The code always worked and didn't change.

Even the default code gives this error, without any adjustments...

This code : https://raw.githubusercontent.com/bruhautomation/ESP-MQTT-JSON-Digital-LEDs/master/ESP_MQTT_Digital_LEDs/ESP_MQTT_Digital_LEDs.ino

Gives this error:

Arduino: 1.8.5 (Mac OS X), Board: "WeMos D1 R1, 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

WARNING: Category 'LED' in library CHT16K33 LED Matrix Library is not valid. Setting to 'Uncategorized'
WARNING: Category 'Input' in library MechInputs is not valid. Setting to 'Uncategorized'
WARNING: Category 'Input' in library SerialSensors is not valid. Setting to 'Uncategorized'
Build options changed, rebuilding all
In file included from /Users/marcel/Documents/Arduino/Kerstboom/Kerstboom.ino:26:0:
/Users/marcel/Documents/Arduino/libraries/FastLED/FastLED.h:17:21: note: #pragma message: FastLED version 3.002.000
 #    pragma message "FastLED version 3.002.000"
                     ^
In file included from /Users/marcel/Documents/Arduino/libraries/FastLED/FastLED.h:68:0,
                 from /Users/marcel/Documents/Arduino/Kerstboom/Kerstboom.ino:26:
/Users/marcel/Documents/Arduino/libraries/FastLED/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^
/Users/marcel/Documents/Arduino/Kerstboom/Kerstboom.ino: In function 'bool processJson(char*)':
Kerstboom:309: error: 'StaticJsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
   ^
Kerstboom:309: error: 'jsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                                 ^
Kerstboom:313: error: 'class ArduinoJson::JsonObject' has no member named 'success'
   if (!root.success()) {
             ^
Kerstboom:388: error: 'MILLION' was not declared in this scope
       unsigned int kelvin  = MILLION / color_temp;
                              ^
/Users/marcel/Documents/Arduino/Kerstboom/Kerstboom.ino: In function 'void sendState()':
Kerstboom:420: error: 'StaticJsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
   ^
Kerstboom:420: error: 'jsonBuffer' was not declared in this scope
   StaticJsonBuffer<BUFFER_SIZE> jsonBuffer;
                                 ^
Kerstboom:425: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject&' from an rvalue of type 'ArduinoJson::JsonObject'
   JsonObject& color = root.createNestedObject("color");
                                                      ^
Kerstboom:434: error: 'class ArduinoJson::JsonObject' has no member named 'measureLength'
   char buffer[root.measureLength() + 1];
                    ^
Kerstboom:435: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
   root.printTo(buffer, sizeof(buffer));
        ^
Kerstboom:435: error: 'buffer' was not declared in this scope
   root.printTo(buffer, sizeof(buffer));
                ^
exit status 1
'StaticJsonBuffer' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@zuidwijk
Copy link

It seems to be a known issue... bblanchon/ArduinoJson#756

I rolled back to ArduinoJson version 5.13.1 and everything works fine again

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants