Projet pour réaliser un 1 2 3 Soleil automatique.
Dependencies: mbed mbed-os MAX7219 rtos
Diff: source.cpp
- Revision:
- 0:f16dce4818bf
diff -r 000000000000 -r f16dce4818bf source.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/source.cpp Sun Dec 23 18:16:49 2018 +0000 @@ -0,0 +1,159 @@ +//#include "hearder.h" + +/*void Gagner(Max7219 deviceM) +{ + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b01100100); + deviceM.write_digit(1,3,0b01100010); + deviceM.write_digit(1,4,0b00000010); + deviceM.write_digit(1,5,0b00000010); + deviceM.write_digit(1,6,0b01100010); + deviceM.write_digit(1,7,0b01100100); + deviceM.write_digit(1,8,0b00000000); +} + +void Perdu(Max7219 deviceM) +{ + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b01100010); + deviceM.write_digit(1,3,0b01100100); + deviceM.write_digit(1,4,0b00000100); + deviceM.write_digit(1,5,0b00000100); + deviceM.write_digit(1,6,0b01100100); + deviceM.write_digit(1,7,0b01100010); + deviceM.write_digit(1,8,0b00000000); +} +void Soleil(Max7219 deviceM) +{ + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b00000000); + deviceM.write_digit(1,4,0b01111110); + deviceM.write_digit(1,5,0b01111110); + deviceM.write_digit(1,6,0b00000000); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b01100010); + deviceM.write_digit(1,4,0b01010010); + deviceM.write_digit(1,5,0b01001010); + deviceM.write_digit(1,6,0b01000110); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b01111110); + deviceM.write_digit(1,4,0b01011010); + deviceM.write_digit(1,5,0b01011010); + deviceM.write_digit(1,6,0b01000010); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b10000001); + deviceM.write_digit(1,2,0b01000010); + deviceM.write_digit(1,3,0b00111100); + deviceM.write_digit(1,4,0b01111110); + deviceM.write_digit(1,5,0b01111110); + deviceM.write_digit(1,6,0b00111100); + deviceM.write_digit(1,7,0b01000010); + deviceM.write_digit(1,8,0b10000001); +} +void Clear(Max7219 deviceM) +{ + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b00000000); + deviceM.write_digit(1,4,0b00000000); + deviceM.write_digit(1,5,0b00000000); + deviceM.write_digit(1,6,0b01000010); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); +} + +void Aff(Max7219 deviceM) +{ + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b01100100); + deviceM.write_digit(1,3,0b01100010); + deviceM.write_digit(1,4,0b00000010); + deviceM.write_digit(1,5,0b00000010); + deviceM.write_digit(1,6,0b01100010); + deviceM.write_digit(1,7,0b01100100); + deviceM.write_digit(1,8,0b00000000); + + wait(1); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b01100010); + deviceM.write_digit(1,3,0b01100100); + deviceM.write_digit(1,4,0b00000100); + deviceM.write_digit(1,5,0b00000100); + deviceM.write_digit(1,6,0b01100100); + deviceM.write_digit(1,7,0b01100010); + deviceM.write_digit(1,8,0b00000000); + + wait(1); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b00000000); + deviceM.write_digit(1,4,0b01111110); + deviceM.write_digit(1,5,0b01111110); + deviceM.write_digit(1,6,0b00000000); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b01100010); + deviceM.write_digit(1,4,0b01010010); + deviceM.write_digit(1,5,0b01001010); + deviceM.write_digit(1,6,0b01000110); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b01111110); + deviceM.write_digit(1,4,0b01011010); + deviceM.write_digit(1,5,0b01011010); + deviceM.write_digit(1,6,0b01000010); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + + wait_ms(500); + + deviceM.write_digit(1,1,0b10000001); + deviceM.write_digit(1,2,0b01000010); + deviceM.write_digit(1,3,0b00111100); + deviceM.write_digit(1,4,0b01111110); + deviceM.write_digit(1,5,0b01111110); + deviceM.write_digit(1,6,0b00111100); + deviceM.write_digit(1,7,0b01000010); + deviceM.write_digit(1,8,0b10000001); + + wait(1); + deviceM.write_digit(1,1,0b00000000); + deviceM.write_digit(1,2,0b00000000); + deviceM.write_digit(1,3,0b00000000); + deviceM.write_digit(1,4,0b00000000); + deviceM.write_digit(1,5,0b00000000); + deviceM.write_digit(1,6,0b00000000); + deviceM.write_digit(1,7,0b00000000); + deviceM.write_digit(1,8,0b00000000); + +}*/ +