
Interfaçage NeoPixel Ring 12, LPRO MECSE, Arnaud A.
Dependencies: lcd neoPixelRing12 view2 BSP_DISCO_F746NG view1 button
Diff: main.cpp
- Revision:
- 9:89d39fc98b17
- Parent:
- 8:aa1e315bf408
- Child:
- 13:0708365334c4
--- a/main.cpp Sun Jun 14 19:14:21 2020 +0000 +++ b/main.cpp Mon Jun 15 00:42:25 2020 +0000 @@ -22,6 +22,7 @@ char g[7] = "00ff00"; char b[7] = "0000ff"; + void bit0(){ myled = 1; wait_ns(190); @@ -36,11 +37,11 @@ wait_ns(600); } -void pressed(){ +void press(){ led1=1; } -void released(){ +void releas(){ npr.setLights(1, "000000"); npr.rst(); npr.setLights(12, "000000"); @@ -50,44 +51,14 @@ int main() { - TS_StateTypeDef TS_State; - uint16_t x, y; - uint8_t idx; - uint8_t cleared = 0; - uint8_t prev_nb_touches = 0; - View v; - - while(1) { - - v.updateLoop(); - BSP_TS_GetState(&TS_State); - if (TS_State.touchDetected) { //Detecte si l'écran tactile est touché - cleared = 0; - //sprintf((char*)text, "Touches: %d", TS_State.touchDetected); - //BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE); - for (idx = 0; idx < TS_State.touchDetected; idx++) { - x = TS_State.touchX[idx]; - y = TS_State.touchY[idx]; - v.contain(x, y); - - } - - - } else { - if (!cleared) { - v.draw(); - //sprintf((char*)text, "Touches: 0"); - //BSP_LCD_DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE); - cleared = 1; - - } - } - } + while(1){ + v.updateLCD(); + } //************************************************* int i=0; - button.rise(&pressed); - button.fall(&released); + button.rise(&press); + button.fall(&releas); //CriticalSectionLock lock; //bit0(); //CriticalSectionLock unlock;