Robot-Will / Stino

A Sublime Text Plugin for Arduino
Other
1.58k stars 250 forks source link

Adafruit_ssd1306 example did not compile #417

Closed KurtE closed 7 years ago

KurtE commented 7 years ago

The library is up at: https://github.com/adafruit/Adafruit_SSD1306

I tried compiling their example for 128x64 spi and first off it did not want to find Wire library... I imported the library again, and then, ran into compile errors.

C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino: In function 'void setup()':
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:97:16: error: 'testdrawline' was not declared in this scope
   testdrawline();
                ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:103:16: error: 'testdrawrect' was not declared in this scope
   testdrawrect();
                ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:109:16: error: 'testfillrect' was not declared in this scope
   testfillrect();
                ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:115:18: error: 'testdrawcircle' was not declared in this scope
   testdrawcircle();
                  ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:126:21: error: 'testdrawroundrect' was not declared in this scope
   testdrawroundrect();
                     ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:130:21: error: 'testfillroundrect' was not declared in this scope
   testfillroundrect();
                     ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:134:20: error: 'testdrawtriangle' was not declared in this scope
   testdrawtriangle();
                    ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:138:20: error: 'testfilltriangle' was not declared in this scope
   testfilltriangle();
                    ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:143:16: error: 'testdrawchar' was not declared in this scope
   testdrawchar();
                ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:149:18: error: 'testscrolltext' was not declared in this scope
   testscrolltext();
                  ^
C:/Users/kurte/Documents/Arduino/libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino:179:72: error: 'testdrawbitmap' was not declared in this scope
   testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
                                                                        ^
[Build] Error occurred.

Note: I have edited libraries, but program does build file on Arduino 1.8.2 Teensyduino latest, and T3.6 selected.

It is like it is not autogenerating the appropriate functions forward references.

Robot-Will commented 7 years ago

Fixed, still caused by macro, thanks,

buzzy commented 5 years ago

I have the exact same problem now with PlatformIO with latest master. Any idea how to fix?

`Processing d1_mini (platform: espressif8266; board: d1_mini; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html PLATFORM: Espressif 8266 > WeMos D1 R2 & mini SYSTEM: ESP8266 80MHz 80KB RAM (4MB Flash) Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF MODES: FINDER(chain) COMPATIBILITY(soft) Collected 29 compatible libraries Scanning dependencies... Dependency Graph |-- 1.3.2 #33158b3 | |-- 1.0 |-- 1.2.5 #fd9ac1d | |-- 1.0 | |-- 1.3.2 #33158b3 | | |-- 1.0 | |-- 1.0 |-- 1.0 Compiling .pioenvs/d1_mini/src/main.cpp.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_phy.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_postmortem.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_si2c.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_sigma_delta.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_timer.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_waveform.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_wiring.c.o src/main.cpp: In function 'void setup()': src/main.cpp:84:16: error: 'testdrawline' was not declared in this scope testdrawline(); // Draw many lines ^ src/main.cpp:86:16: error: 'testdrawrect' was not declared in this scope testdrawrect(); // Draw rectangles (outlines) ^ src/main.cpp:88:16: error: 'testfillrect' was not declared in this scope testfillrect(); // Draw rectangles (filled) ^ src/main.cpp:90:18: error: 'testdrawcircle' was not declared in this scope testdrawcircle(); // Draw circles (outlines) ^ src/main.cpp:92:18: error: 'testfillcircle' was not declared in this scope testfillcircle(); // Draw circles (filled) ^ src/main.cpp:94:21: error: 'testdrawroundrect' was not declared in this scope testdrawroundrect(); // Draw rounded rectangles (outlines) ^ src/main.cpp:96:21: error: 'testfillroundrect' was not declared in this scope testfillroundrect(); // Draw rounded rectangles (filled) ^ src/main.cpp:98:20: error: 'testdrawtriangle' was not declared in this scope testdrawtriangle(); // Draw triangles (outlines) ^ src/main.cpp:100:20: error: 'testfilltriangle' was not declared in this scope testfilltriangle(); // Draw triangles (filled) ^ src/main.cpp:102:16: error: 'testdrawchar' was not declared in this scope testdrawchar(); // Draw characters of the default font ^ src/main.cpp:104:18: error: 'testdrawstyles' was not declared in this scope testdrawstyles(); // Draw 'stylized' characters ^ src/main.cpp:106:18: error: 'testscrolltext' was not declared in this scope testscrolltext(); // Draw scrolling text ^ src/main.cpp:108:18: error: 'testdrawbitmap' was not declared in this scope testdrawbitmap(); // Draw a small bitmap image ^ src/main.cpp:116:48: error: 'testanimate' was not declared in this scope testanimate(logo_bmp, LOGO_WIDTH, LOGO_HEIGHT); // Animate bitmaps ^ Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_wiring_analog.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_wiring_digital.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_wiring_pulse.c.o Compiling .pioenvs/d1_mini/FrameworkArduino/core_esp8266_wiring_pwm.c.o *** [.pioenvs/d1_mini/src/main.cpp.o] Error 1`

buzzy commented 5 years ago

Ok, I found the problem. The example files are wrong. When I moved the setup() and loop() functions to the end of the file, it worked. You might want to update the examples.

KurtE commented 5 years ago

@buzzy Just an FYI - I currently no longer use Stino as I kept running into memory issues with it and Stino did not follow the same rules as Arduino on which version of library was to be used...

And that @Robot-Will has not updated the code, or issues in over a year and a half.

wavesailor commented 4 years ago

Ok, I found the problem. The example files are wrong. When I moved the setup() and loop() functions to the end of the file, it worked. You might want to update the examples.

Thanks ... That solved it for me