#include #include #include #include void fonction_led(char* couleur, int position) { //a modifier avec le reel printf("(La led %s se met en position %d.)\n", couleur, position); } void affiche_lcd(char* contenu) { //a modifier par l'utlisation des lib printf ("[LCD : %s]\n", contenu); } char* choix_aleatoire(void) { //fonctionne char* couleur_leds[3]={"R","V","J"}; //nos led srand(time(0)); int aleatoire = (rand() % (2 - 0 + 1)) + 0; //choix entre 0 et 2 char* choix = couleur_leds[aleatoire]; return choix; } int main(void) { affiche_lcd("Bienvenue sur SIMON_STM32"); int etat_bouton_start = 1; //a changer en fonction des pins et tout int niveau = 0; char* suite_de_leds[100]; int perdu = 0; int tour=0; while (tour<10 && perdu!= 1) { if (etat_bouton_start){//a changer... affiche_lcd("Let's go !"); suite_de_leds[niveau] = choix_aleatoire(); niveau++; for (int i = 0; i