fork of seeed studio 4-digit display for st nucleo board
Dependencies: Data_Clock_Pair Seeed_Chainable_LED Seeed_Four_Digit_Disp Seeed_IR_Temp_Sensor Seeed_Led_Bar
Fork of Seeed_Grove_4_Digit_Display_Clock by
Diff: main.cpp
- Revision:
- 12:a16d86fac131
- Parent:
- 7:b16b9733d859
- Child:
- 15:abda719ba6e6
--- a/main.cpp Fri Apr 21 13:47:19 2017 +0000 +++ b/main.cpp Thu Apr 27 16:08:02 2017 -0600 @@ -20,10 +20,22 @@ int main() { pc.printf("\n\nstarting algorithm\n\n"); - SeeedLedBar ledBar = SeeedLedBar(PE_9, PF_13); - SeeedFourDigitDisp disp = SeeedFourDigitDisp(PE_13, PF_15); - SeeedQTouch qTouch = SeeedQTouch(PB_9, PB_8); - SeeedChainableLED led_chain = SeeedChainableLED(PE_11, PF_14); + DataClockPair chainablePins, rgbPins, qTouchPins, dispPins, ledBarPins; + ledBarPins.dataPin = PE_9; + ledBarPins.clockPin = PF_13; + dispPins.dataPin = PE_13; + dispPins.clockPin = PF_15; + qTouchPins.dataPin = PB_9; + qTouchPins.clockPin = PB_8; + rgbPins.dataPin = PG_14; + rgbPins.clockPin = PG_9; + chainablePins.clockPin = PF_14; + chainablePins.dataPin = PE_11; + SeeedLedBar ledBar(ledBarPins); + SeeedFourDigitDisp disp(dispPins); + SeeedQTouch qTouch(qTouchPins); + SeeedChainableLED led_chain(chainablePins); + SeeedChainableLED rgb_led(rgbPins); Thread blinky(led_thread); @@ -32,8 +44,10 @@ ledBar.ten_on(); disp.clear_display(); led_chain.turn_on(); - led_chain.set_color_rgb(100,200,100); + led_chain.set_color_rgb(100,50,0); + rgb_led.set_color_rgb(50,200,10); while (1) { + qTouch.key_touch(&pc); float led_frac = knob.read(); int led_percent = floor(led_frac * 100); int tens = floor(led_frac * 10); @@ -47,6 +61,6 @@ disp.set_integer(led_percent); int eightBitInput = led_frac * 255; led_chain.set_color_rgb(eightBitInput, eightBitInput, eightBitInput); - Thread::wait(10); + Thread::wait(2000); } }