Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 580824e

Browse files
committed
add platformio support and makefiles
add heltec wifi lora 32 OLED example
1 parent 21d3c06 commit 580824e

File tree

16 files changed

+139
-1
lines changed

16 files changed

+139
-1
lines changed

.common/Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# makefile to build examples with platformi
2+
#
3+
.PHONY: run clean upload monitor ci envdump
4+
5+
run:
6+
pio run
7+
8+
envdump:
9+
-pio run --target envdump
10+
11+
clean:
12+
-pio run --target clean
13+
14+
upload:
15+
pio run --target upload
16+
17+
monitor:
18+
pio device monitor
19+
20+
tags:
21+
ctags -R

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*~
2+
.pioenvs/
3+
.piolibdeps/
24
libraries
35
libraries/*

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ Allows simple printf-like formatting and shows current time in millis and availa
5151
5252
## Sketches
5353
54+
To build the demo sketches you can either copy the folders to the source
55+
folder of your Arduino IDE or use PlatformIO and the provided makefiles, e.g.:
56+
57+
```
58+
$ cd cjmcu_8x8_sample
59+
$ make upload
60+
```
61+
62+
The following make targets can be used: run, envdump, clean, upload, monitor
63+
5464
### Interfacing SSD1306 based OLED displays (SPI)
5565
5666
<img alt="ssd1306" width=256 src="images/ssd1306.jpg">
@@ -113,5 +123,6 @@ transceiver.
113123
* the builtin LED is connected to `GPIO 25` (e.g. use `digitalWrite(25, 255)`)
114124
and is low active.
115125
* OLED: u8glib configuration `U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 15, /* data=*/ 4, /* reset=*/ 16);`
116-
* more to come
126+
* see [example sketch](heltec_wifi_lora32) for an example on how to use the OLED
127+
* will add Lora example later ...
117128

cjmcu_8x8_sample/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.common/Makefile

cjmcu_8x8_sample/platformio.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; PlatformIO Project Configuration File
2+
;
3+
; Build options: build flags, source filter
4+
; Upload options: custom upload port, speed and extra flags
5+
; Library options: dependencies, extra library storages
6+
; Advanced options: extra scripting
7+
;
8+
; Please visit documentation for the other options and examples
9+
; http://docs.platformio.org/page/projectconf.html
10+
11+
[platformio]
12+
env_default = nanoatmega328
13+
src_dir = .
14+
15+
[env:nanoatmega328]
16+
platform = atmelavr
17+
board = nanoatmega328
18+
framework = arduino
19+
lib_deps=FastLED
20+

esp32_ttgo/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.common/Makefile

esp32_ttgo/platformio.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[platformio]
2+
env_default = esp32
3+
src_dir = .
4+
5+
[env:esp32]
6+
platform = espressif32
7+
board = esp32dev
8+
framework = arduino
9+
lib_deps=U8g2
10+

heltec_wifi_lora32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.common/Makefile
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Heltec Lora Wifi 32 OLED Demo
2+
3+
#include <Arduino.h>
4+
#include <U8x8lib.h>
5+
#include <SPI.h>
6+
7+
8+
U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 15, /* data=*/ 4, /* reset=*/ 16);
9+
10+
void setup(void)
11+
{
12+
u8x8.begin();
13+
14+
u8x8.setFont(u8x8_font_amstrad_cpc_extended_f);
15+
u8x8.clear();
16+
17+
u8x8.setCursor(0,0);
18+
u8x8.print("Heltec Wifi");
19+
u8x8.setCursor(0,1);
20+
u8x8.print("Lora 32");
21+
}
22+
23+
24+
void loop(void)
25+
{
26+
delay(1000);
27+
}
28+

heltec_wifi_lora32/platformio.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[platformio]
2+
env_default = esp32
3+
src_dir = .
4+
5+
[env:esp32]
6+
platform = espressif32
7+
board = esp32dev
8+
framework = arduino
9+
lib_deps=U8g2
10+

0 commit comments

Comments
 (0)