pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT
Dependencies: mbed MMA8451Q USBDevice WakeUp vt100
Fork of afero_node_suntory_2017_06_15 by
main.cpp@6:88cc04eb613a, 2017-03-22 (annotated)
- Committer:
- wataloh
- Date:
- Wed Mar 22 23:39:41 2017 +0000
- Revision:
- 6:88cc04eb613a
- Parent:
- 5:9d5c7ee80f3b
- Child:
- 10:02e481a80843
New calib vals for LED RGB.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wataloh | 0:20bce0dcc921 | 1 | #include "mbed.h" |
wataloh | 0:20bce0dcc921 | 2 | #include "AferoCommHndlr.h" |
wataloh | 0:20bce0dcc921 | 3 | #include "pin_defines.h" |
wataloh | 0:20bce0dcc921 | 4 | #include "RTC_Handler.h" |
wataloh | 1:b2a9a6f2c30e | 5 | #include "Preferences.hpp" |
wataloh | 2:dfe671e31221 | 6 | #include "WakeUp.h" |
wataloh | 5:9d5c7ee80f3b | 7 | #include "DebugIO.hpp" |
wataloh | 6:88cc04eb613a | 8 | #include "WatchDoggy.hpp" |
wataloh | 0:20bce0dcc921 | 9 | |
wataloh | 0:20bce0dcc921 | 10 | Timer t; |
wataloh | 0:20bce0dcc921 | 11 | |
wataloh | 0:20bce0dcc921 | 12 | int |
wataloh | 0:20bce0dcc921 | 13 | main() |
wataloh | 0:20bce0dcc921 | 14 | { |
wataloh | 2:dfe671e31221 | 15 | WakeUp::calibrate(); |
wataloh | 6:88cc04eb613a | 16 | wait_ms(500); |
wataloh | 6:88cc04eb613a | 17 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 18 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 19 | #endif //TARGET_KL25Z |
wataloh | 0:20bce0dcc921 | 20 | t.start(); |
wataloh | 5:9d5c7ee80f3b | 21 | DebugIO::init(); |
wataloh | 5:9d5c7ee80f3b | 22 | DebugIO::test(); |
wataloh | 0:20bce0dcc921 | 23 | mbedSPI mbedspi; |
wataloh | 1:b2a9a6f2c30e | 24 | DigitalOut ASR1Reset( |
wataloh | 1:b2a9a6f2c30e | 25 | (PinName)PINS::ASR_1::RESET, |
wataloh | 1:b2a9a6f2c30e | 26 | PINS::ASR_1::SIG::RESET::DEASSERT); |
wataloh | 1:b2a9a6f2c30e | 27 | ASR1Reset = PINS::ASR_1::SIG::RESET::ASSERT; |
wataloh | 6:88cc04eb613a | 28 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 29 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 30 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 31 | #endif //TARGET_KL25Z |
wataloh | 6:88cc04eb613a | 32 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 33 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 34 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 35 | #endif //TARGET_KL25Z |
wataloh | 6:88cc04eb613a | 36 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 37 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 38 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 39 | #endif //TARGET_KL25Z |
wataloh | 1:b2a9a6f2c30e | 40 | ASR1Reset = PINS::ASR_1::SIG::RESET::DEASSERT; |
wataloh | 6:88cc04eb613a | 41 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 42 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 43 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 44 | #endif //TARGET_KL25Z |
wataloh | 6:88cc04eb613a | 45 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 46 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 47 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 48 | #endif //TARGET_KL25Z |
wataloh | 6:88cc04eb613a | 49 | wait_ms(300); |
wataloh | 6:88cc04eb613a | 50 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 51 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 52 | #endif //TARGET_KL25Z |
wataloh | 6:88cc04eb613a | 53 | |
wataloh | 0:20bce0dcc921 | 54 | AferoCommHndlr *aHnd = AferoCommHndlr::create(&t,&mbedspi); |
wataloh | 0:20bce0dcc921 | 55 | while(1) { |
wataloh | 5:9d5c7ee80f3b | 56 | #if defined(TARGET_KL25Z) |
wataloh | 6:88cc04eb613a | 57 | wtd.reset(); |
wataloh | 6:88cc04eb613a | 58 | #endif //TARGET_KL25Z |
wataloh | 0:20bce0dcc921 | 59 | aHnd->loop(); |
wataloh | 0:20bce0dcc921 | 60 | } |
wataloh | 0:20bce0dcc921 | 61 | } |