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

Dependencies:   lcd neoPixelRing12 view2 BSP_DISCO_F746NG view1 button

Committer:
Rhamao
Date:
Wed Jun 17 16:34:21 2020 +0000
Revision:
13:0708365334c4
Parent:
9:89d39fc98b17
Child:
14:7b74ad030896
View 1 finie

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 13:0708365334c4 5 #include "neoPixelRing12.h"
Rhamao 8:aa1e315bf408 6 #include "view.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 8:aa1e315bf408 10 #include <list>
Rhamao 8:aa1e315bf408 11 #define SCREENWIDTH 480
Rhamao 8:aa1e315bf408 12 #define SCREENHEIGHT 272
Rhamao 6:91e478ee227e 13
Rhamao 6:91e478ee227e 14 #define USE_CRITICAL_SECTION_LOCK 1 // Set 0 to see race condition
Rhamao 6:91e478ee227e 15
Rhamao 8:aa1e315bf408 16 uint8_t text[30];
Rhamao 6:91e478ee227e 17 DigitalOut myled(D8);
Rhamao 6:91e478ee227e 18 DigitalOut led1(LED1);
Rhamao 7:1887c4e4b5de 19 NeoPixelRing12 npr(D8);
Rhamao 13:0708365334c4 20 LCD disco;
Rhamao 13:0708365334c4 21 View v;
bcostm 0:b045ca817e2c 22
bcostm 0:b045ca817e2c 23 int main()
Jerome Coutant 5:e8f8a8037256 24 {
Rhamao 13:0708365334c4 25
Rhamao 13:0708365334c4 26 disco.initLCD();
Rhamao 13:0708365334c4 27 v.initView();
Rhamao 13:0708365334c4 28
Rhamao 13:0708365334c4 29 //lcd->initLCD();
Rhamao 9:89d39fc98b17 30 while(1){
Rhamao 9:89d39fc98b17 31 v.updateLCD();
Rhamao 9:89d39fc98b17 32 }
Rhamao 8:aa1e315bf408 33 //*************************************************
Rhamao 6:91e478ee227e 34 int i=0;
Rhamao 6:91e478ee227e 35 //CriticalSectionLock lock;
Rhamao 6:91e478ee227e 36 //bit0();
Rhamao 6:91e478ee227e 37 //CriticalSectionLock unlock;
Rhamao 7:1887c4e4b5de 38
Rhamao 7:1887c4e4b5de 39 //Une led à 0 avant d'envoyer la trame pour éviter
Rhamao 7:1887c4e4b5de 40 //le bug de trame
Rhamao 7:1887c4e4b5de 41 npr.setLights(1, "ff0000");
Rhamao 7:1887c4e4b5de 42 npr.rst();
Rhamao 7:1887c4e4b5de 43 //la trame
Rhamao 13:0708365334c4 44 npr.setLights(5, "00ff00");
Rhamao 13:0708365334c4 45 npr.setLights(2, "ff0000");
Rhamao 13:0708365334c4 46 npr.setLights(4, "0000ff");
Rhamao 7:1887c4e4b5de 47 npr.rst();
Rhamao 7:1887c4e4b5de 48 wait(100.0);
Rhamao 6:91e478ee227e 49 }
bcostm 0:b045ca817e2c 50
bcostm 0:b045ca817e2c 51