Interfaçage NeoPixel Ring 12, LPRO MECSE, Arnaud A.

Dependencies:   lcd neoPixelRing12 view2 BSP_DISCO_F746NG view1 button

Committer:
Rhamao
Date:
Mon Jun 22 21:56:12 2020 +0000
Revision:
14:7b74ad030896
Parent:
13:0708365334c4
Child:
15:567aecbdc323
mm

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:b045ca817e2c 1 #include "mbed.h"
Rhamao 6:91e478ee227e 2 #include "Thread.h"
Rhamao 6:91e478ee227e 3 #include "rtos_idle.h"
Rhamao 6:91e478ee227e 4 #include "mbed_critical.h"
Rhamao 14:7b74ad030896 5 #include "neoPixelRing12/neoPixelRing12.h"
Rhamao 14:7b74ad030896 6 #include "view1.h"
Rhamao 8:aa1e315bf408 7 #include "stm32746g_discovery_lcd.h"
Rhamao 8:aa1e315bf408 8 #include "stm32746g_discovery_ts.h"
Rhamao 13:0708365334c4 9 #include "lcd/lcd.h"
Rhamao 14:7b74ad030896 10 #include "view2/view2.h"
Rhamao 8:aa1e315bf408 11 #include <list>
Rhamao 8:aa1e315bf408 12 #define SCREENWIDTH 480
Rhamao 8:aa1e315bf408 13 #define SCREENHEIGHT 272
Rhamao 6:91e478ee227e 14
Rhamao 6:91e478ee227e 15 #define USE_CRITICAL_SECTION_LOCK 1 // Set 0 to see race condition
Rhamao 6:91e478ee227e 16
Rhamao 7:1887c4e4b5de 17 NeoPixelRing12 npr(D8);
Rhamao 13:0708365334c4 18 LCD disco;
Rhamao 14:7b74ad030896 19 View1 v1;
Rhamao 14:7b74ad030896 20 View2 v2;
Rhamao 14:7b74ad030896 21 TS_StateTypeDef TS_State;
Rhamao 14:7b74ad030896 22 char RGBmap[12][7];
bcostm 0:b045ca817e2c 23
bcostm 0:b045ca817e2c 24 int main()
Jerome Coutant 5:e8f8a8037256 25 {
Rhamao 13:0708365334c4 26
Rhamao 13:0708365334c4 27 disco.initLCD();
Rhamao 14:7b74ad030896 28 v1.initView();
Rhamao 14:7b74ad030896 29 v2.initView();
Rhamao 14:7b74ad030896 30 npr.setLights(12, "000000");
Rhamao 14:7b74ad030896 31 CriticalSectionLock lock;
Rhamao 14:7b74ad030896 32 //npr.setLights(12, "000000");
Rhamao 14:7b74ad030896 33 npr.ironManRepulsorBlastAnimations();
Rhamao 14:7b74ad030896 34 CriticalSectionLock unlock;
Rhamao 9:89d39fc98b17 35 while(1){
Rhamao 14:7b74ad030896 36 if(!v1.getViewChanged()){
Rhamao 14:7b74ad030896 37 v1.updateLCD();
Rhamao 14:7b74ad030896 38 if(v1.getSetNewColorEnabled()){
Rhamao 14:7b74ad030896 39 v1.getRGBmap(RGBmap);
Rhamao 14:7b74ad030896 40 CriticalSectionLock lock;
Rhamao 14:7b74ad030896 41 npr.setLights(RGBmap);
Rhamao 14:7b74ad030896 42 CriticalSectionLock unlock;
Rhamao 14:7b74ad030896 43 }
Rhamao 14:7b74ad030896 44 }else{
Rhamao 14:7b74ad030896 45 v2.updateLCD();
Rhamao 14:7b74ad030896 46 v1.setViewChanged(!v2.getViewChanged());
Rhamao 14:7b74ad030896 47 }
Rhamao 14:7b74ad030896 48 }
Rhamao 6:91e478ee227e 49 }
bcostm 0:b045ca817e2c 50
bcostm 0:b045ca817e2c 51