TP3_2GII
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 00002 //---------------------- 08_TP4_Ex1_1 ---------------------------- 00003 // Affichage d'un chiffre hexadécimal (de 0 à F) toutes les secondes 00004 //--------------------------------------------------------------------- 00005 #include "mbed.h" 00006 BusOut Aff_7Seg(PB_3, PA_15, PA_12, PA_11, PA_10, PA_9, PA_8); 00007 BusOut D(PB_12,PB_13,PB_14,PB_15); 00008 int Caract_7Seg[] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 00009 0x7F, 0x6F, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71 }; 00010 char Compteur; 00011 int main() { 00012 D=1; // 1er Aff ->D=1, 2eme Aff ->D=2, 3eme Aff->D=4, 4eme Aff->D=8 00013 while(1) { 00014 Aff_7Seg = Caract_7Seg[(Compteur++)%16 ]; 00015 wait(1); 00016 } 00017 } 00018
Generated on Tue Oct 11 2022 07:49:57 by
1.7.2