From bdb581732ba867ba0d79be97c83f3f624be538cd Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 7 Feb 2018 15:01:15 +0100 Subject: [PATCH] more documentation --- src/hardware.h | 29 +++++++++++++++++++++++------ src/main.cpp | 6 +++++- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/hardware.h b/src/hardware.h index 387df83..93d88e5 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -16,7 +16,7 @@ static constexpr uint8_t PROGMEM NUM_LEDS = 10; static constexpr uint8_t ext_wakeup_pin_1 = 0; static constexpr uint8_t ext_wakeup_pin_2 = 0; -static constexpr uint32_t secondsToSleep = 3600; +static constexpr uint32_t secondsToSleep = 30*60; /* Wiring (Heltec OLED Lora) @@ -34,18 +34,35 @@ static constexpr uint32_t secondsToSleep = 3600; * 18 x LoRa_CS * 25 MAX98_DIN * BME280_SCL/SCK 5 * LoRa_SCK LoRa_IRQ * 26 * 15 * OLED_SCL LoRa_MOSI * 27 BME280_SDA/SDI - * 2 * LED_B LoRa_RST * 14 + * ROTARY_BTN 2 * LED_B LoRa_RST * 14 * 4 * OLED_SDA * 12 MAX98_BCLK - * ROTARY_BTN 17 * * 13 MAX98_LRC + * 17 * * 13 MAX98_LRC * 16 * OLED_RST * 21 WS2812B_DATA(?) */ /* Rotary Encoder * 1 LED - * pinA A 2 LED pinA und PinB mit externen Pullups - * GND C 3 BTN -| + * pinA A 2 LED pinA und PinB mit zusätzlichen externen Pullups + * GND C 3 BTN -| --ROTARY_BTN * pinB B 4 LED / - * 5 Vin -| + * 5 Vin -| --R?--3V3 + */ + +/* load-shedding idea: +5V + * | + * ---R2(1k)------| + * | | + * o------------|--| Q2 + * | |>-° P-Channel MOSFET + * | |-- IRF9350 / SUP75P03-07-E3 + * |/ T1 | + * gpio ---R1(10k)---| 2N2904 ---- LED/AMP Power 5V + * |\ + * v + * | + * GND + * (https://www.pjrc.com/teensy/td_libs_OctoWS2811.html) + * (https://learn.adafruit.com/rgb-led-strips/usage) (IRLB8721 N-Channel) */ diff --git a/src/main.cpp b/src/main.cpp index 51ae4b0..d17c70c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,6 +12,8 @@ #include #include +#include "esp_wifi.h" + #include #ifdef U8X8_HAVE_HW_SPI #include @@ -67,6 +69,8 @@ void setup() { boot_count++; + static wifi_country_t wifi_country = {.cc="EU", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_AUTO}; + esp_wifi_set_country(&wifi_country); //Initialize Basecamp iot.begin(); @@ -277,7 +281,7 @@ void loop() } - if(millis() - lastTransmit >= 60000) { + if(millis() - lastTransmit >= 60*1000) { lastTransmit = millis(); transmitStatus(); }