Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By picstart
#30963 I have this working in the eclipse esp8266 IDE with modified TFT drivers from a PIC MCU.
The arduino esp IDE is convenient so I thought the ucglib library might be a good solution since it looks like it might have working ST7735 code.
The issue is has anyone got this working with the arduino esp IDE? I'm getting a zillion compile errors.
[code] In file included from HelloWorld_ucglib.ino:49:0:
C:\Arduino\arduino-1.6.5\libraries\Ucglib_Arduino-1.3.3\src/Ucglib.h:7:19: warning: character constant too long for its type [enabled by default]
<meta charset='utf-8'> [/code]
I suspect it might work on a arduino board but here I want to compile to the esp8266 MCU. I may have downloaded the wrong library or an out of date library
A link to a working library with a sample "hello world" sketch would be much appreciated.
User avatar
By erhardd
#30972 I think you work on Windows?
C:\Arduino\arduino-1.6.5\libraries\
Look at this:
viewtopic.php?p=30066#p30066

You have to unpack the Lib and to add it in "libraries"as Ucglib. But remove the Ucglib_Arduino-1.3.3!
Than open the sketch and let it compile ..

By the way: Thanks to Oldmicroguy for the hint: --
"The default download does not include the ZIP program which is needed so before you download open the Archive Package and select the ZIP program to be included in the download."
You do not have the required permissions to view the files attached to this post.
User avatar
By picstart
#31018 Thanks for the help and I believe you may have been able to get a successful compile so I tried your code.

I used your ucglib.7z .
First I removed all other ucglib subfolders in libraries. Then I unpacked your library into libraries.
Ardruino often has embedded dependencies in your ucglib the dependencies was with uclib since it depended on the German language and the a user dependency.
I do a fresh start every time of Arduino since that's when it reads the file structure.
I dislike dependencies so I run Arduino with the Portable feature that can constrain all Arduino files to a single directory making transfers and backups easy.

ucglib.h now has the is modified include..#include "utility/ucg.h"

I suspect there are other hidden dependencies since I get the compile errors below.

[quote]Arduino: 1.6.5 (Windows 7), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS)"

In file included from C:\Arduino\arduino-1.6.5\libraries\Ucglib/Ucglib.h:61:0,
from HelloWorld_ucglib.ino:1:
C:\Arduino\arduino-1.6.5\libraries\Ucglib/utility/ucg.h:119:0: warning: "ICACHE_FLASH_ATTR" redefined [enabled by default]
# define ICACHE_FLASH_ATTR UCG_SECTION(".irom0.text")
^
In file included from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/esp8266_peri.h:24:0,
from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/Arduino.h:38,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib/Ucglib.h:54,
from HelloWorld_ucglib.ino:1:
C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0/tools/sdk/include/c_types.h:69:0: note: this is the location of the previous definition
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
^
In file included from C:\Arduino\arduino-1.6.5\libraries\Ucglib/Ucglib.h:61:0,
from HelloWorld_ucglib.ino:1:
C:\Arduino\arduino-1.6.5\libraries\Ucglib/utility/ucg.h:136:0: warning: "PGM_VOID_P" redefined [enabled by default]
#define PGM_VOID_P const void *1
^
In file included from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/Arduino.h:230:0,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib/Ucglib.h:54,
from HelloWorld_ucglib.ino:1:
C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/pgmspace.h:17:0: note: this is the location of the previous definition
#define PGM_VOID_P const void *
^
In file included from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.h:61:0,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.cpp:41:
C:\Arduino\arduino-1.6.5\libraries\Ucglib\utility/ucg.h:119:0: warning: "ICACHE_FLASH_ATTR" redefined [enabled by default]
# define ICACHE_FLASH_ATTR UCG_SECTION(".irom0.text")
^
In file included from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/esp8266_peri.h:24:0,
from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/Arduino.h:38,
from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\libraries\SPI/SPI.h:24,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.cpp:39:
C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0/tools/sdk/include/c_types.h:69:0: note: this is the location of the previous definition
#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text")))
^
In file included from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.h:61:0,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.cpp:41:
C:\Arduino\arduino-1.6.5\libraries\Ucglib\utility/ucg.h:136:0: warning: "PGM_VOID_P" redefined [enabled by default]
#define PGM_VOID_P const void *1
^
In file included from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/Arduino.h:230:0,
from C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\libraries\SPI/SPI.h:24,
from C:\Arduino\arduino-1.6.5\libraries\Ucglib\Ucglib.cpp:39:
C:\Arduino\arduino-1.6.5\portable\packages\esp8266\hardware\esp8266\1.6.5-947-g39819f0\cores\esp8266/pgmspace.h:17:0: note: this is the location of the previous definition
#define PGM_VOID_P const void *
^
c:/arduino/arduino-1.6.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Doug\AppData\Local\Temp\build1826414176886736312.tmp/HelloWorld_ucglib.cpp.elf section `.irom.text.ucg_font_tpssb_hr' will not fit in region `dram0_0_seg'
c:/arduino/arduino-1.6.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: address 0x402e79b0 of C:\Users\Doug\AppData\Local\Temp\build1826414176886736312.tmp/HelloWorld_ucglib.cpp.elf section `.bss' is not within region `dram0_0_seg'
c:/arduino/arduino-1.6.5/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: address 0x402e79b0 of C:\Users\Doug\AppData\Local\Temp\build1826414176886736312.tmp/HelloWorld_ucglib.cpp.elf section `.bss' is not within region `dram0_0_seg'
collect2.exe: error: ld returned 1 exit status
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
[/quote]
User avatar
By norm8332
#31020 I just thought I'd let you know that the latest Adafruit-ST7735-Library already works with Arduino esp IDE. The newest version was made compatible some time ago. I have tested it on an ESP-12E and it works great with hardware SPI. Its on Github: https://github.com/adafruit/Adafruit-ST7735-Library

-Norm