summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-12-03 14:04:23 -0600
committerMike Fiore <mfiore@multitech.com>2015-12-03 14:04:23 -0600
commitc52f29331e76857b4bbab72829479a04e19318cf (patch)
tree7789298b403ad63e1b96dc9a79573514694d617d /main.cpp
parentc3d181e2c45f8b4ddc6572a9834082413fb91817 (diff)
downloadmtdot-box-evb-factory-firmware-c52f29331e76857b4bbab72829479a04e19318cf.tar.gz
mtdot-box-evb-factory-firmware-c52f29331e76857b4bbab72829479a04e19318cf.tar.bz2
mtdot-box-evb-factory-firmware-c52f29331e76857b4bbab72829479a04e19318cf.zip
turn on LED2
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index c3b341a..9f42df3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -24,13 +24,13 @@
#include "FileName.h"
#include <string>
-// LCD and backlight controllers
+// LCD and LED controllers
SPI lcd_spi(SPI1_MOSI, SPI1_MISO, SPI1_SCK);
-I2C backlight_i2c(I2C_SDA, I2C_SCL);
+I2C led_i2c(I2C_SDA, I2C_SCL);
DigitalOut lcd_spi_cs(SPI1_CS, 1);
DigitalOut lcd_cd(XBEE_ON_SLEEP, 1);
DOGS102* lcd;
-NCP5623B* lcd_backlight;
+NCP5623B* led_cont;
// Thread informaiton
osThreadId main_id;
@@ -70,7 +70,7 @@ int main() {
file_name = "SurveyData.txt";
lcd = new DOGS102(lcd_spi, lcd_spi_cs, lcd_cd);
- lcd_backlight = new NCP5623B(backlight_i2c);
+ led_cont = new NCP5623B(led_i2c);
main_id = Thread::gettid();
buttons = new ButtonHandler(main_id);
@@ -78,6 +78,11 @@ int main() {
lora = new LoRaHandler(main_id);
gps = new GPSPARSER(&gps_serial);
+ // NCP5623B::LEDs 1 & 2 are the screen backlight - not used on default build
+ // NCP5623B::LED3 is EVB LED2
+ led_cont->setPWM(NCP5623B::LED_3, 16);
+ led_cont->setLEDCurrent(16);
+
MTSLog::setLogLevel(MTSLog::TRACE_LEVEL);
modeJoin = new ModeJoin(lcd, buttons, dot, lora, gps);