De_ES 2113
Make a dice
 
Loading...
Searching...
No Matches
DeElectronique.h File Reference
#include "xc.h"
#include "Accelerometre.h"
#include <stdbool.h>
Include dependency graph for DeElectronique.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INT_SHAKE   PORTBbits.RB12
 
#define LED0   LATAbits.LATA0
 
#define LED1   LATAbits.LATA1
 
#define LED2   LATAbits.LATA2
 
#define LED3   LATBbits.LATB2
 
#define LED4   LATAbits.LATA3
 
#define LED5   LATBbits.LATB4
 
#define LED6   LATAbits.LATA4
 
#define POWER_HOLD   LATBbits.LATB13
 

Functions

void DISPLAYNONUM (void)
 Éteint toutes les LEDs du dé.
 
void DISPLAY_NUM1 (void)
 Affiche le chiffre 1 sur le dé.
 
void DISPLAY_NUM2 (void)
 Affiche le chiffre 2 sur le dé.
 
void DISPLAY_NUM3 (void)
 Affiche le chiffre 3 sur le dé.
 
void DISPLAY_NUM4 (void)
 Affiche le chiffre 4 sur le dé.
 
void DISPLAY_NUM5 (void)
 Affiche le chiffre 5 sur le dé.
 
void DISPLAY_NUM6 (void)
 Affiche le chiffre 6 sur le dé.
 
void RandomNum (int Number)
 Affiche un nombre aléatoire entre 1 et 6 sur le dé.
 
void Display_Dice_PWM (int NumberToDisplay, char dutyCycle)
 Affiche le nombre sur le dé avec PWM (effet de fade).
 
char fade (char dutyCycle)
 Applique un effet de fondu sur le PWM.
 

Macro Definition Documentation

◆ INT_SHAKE

#define INT_SHAKE   PORTBbits.RB12

◆ LED0

#define LED0   LATAbits.LATA0

◆ LED1

#define LED1   LATAbits.LATA1

◆ LED2

#define LED2   LATAbits.LATA2

◆ LED3

#define LED3   LATBbits.LATB2

◆ LED4

#define LED4   LATAbits.LATA3

◆ LED5

#define LED5   LATBbits.LATB4

◆ LED6

#define LED6   LATAbits.LATA4

◆ POWER_HOLD

#define POWER_HOLD   LATBbits.LATB13

Function Documentation

◆ Display_Dice_PWM()

void Display_Dice_PWM ( int NumberToDisplay,
char dutyCycle )

Affiche le nombre sur le dé avec PWM (effet de fade).

Parameters
NumberToDisplayNombre à afficher.
dutyCycleRapport cyclique du PWM.

Gère l'affichage du nombre avec modulation de largeur d'impulsion pour un effet visuel.

Parameters
NumberToDisplayNombre à afficher (1 à 6).
dutyCycleRapport cyclique du PWM.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DISPLAY_NUM1()

void DISPLAY_NUM1 ( void )

Affiche le chiffre 1 sur le dé.

Allume la LED centrale pour représenter le 1.

Here is the caller graph for this function:

◆ DISPLAY_NUM2()

void DISPLAY_NUM2 ( void )

Affiche le chiffre 2 sur le dé.

Allume deux LEDs opposées pour représenter le 2.

Here is the caller graph for this function:

◆ DISPLAY_NUM3()

void DISPLAY_NUM3 ( void )

Affiche le chiffre 3 sur le dé.

Allume trois LEDs pour représenter le 3.

Here is the caller graph for this function:

◆ DISPLAY_NUM4()

void DISPLAY_NUM4 ( void )

Affiche le chiffre 4 sur le dé.

Allume quatre LEDs pour représenter le 4.

Here is the caller graph for this function:

◆ DISPLAY_NUM5()

void DISPLAY_NUM5 ( void )

Affiche le chiffre 5 sur le dé.

Allume cinq LEDs pour représenter le 5.

Here is the caller graph for this function:

◆ DISPLAY_NUM6()

void DISPLAY_NUM6 ( void )

Affiche le chiffre 6 sur le dé.

Allume six LEDs pour représenter le 6.

Here is the caller graph for this function:

◆ DISPLAYNONUM()

void DISPLAYNONUM ( void )

Éteint toutes les LEDs du dé.

Met toutes les sorties LED à 0 pour éteindre l'affichage du dé.

Here is the caller graph for this function:

◆ fade()

char fade ( char dutyCycle)

Applique un effet de fondu sur le PWM.

Parameters
dutyCycleRapport cyclique actuel.
Returns
Nouveau rapport cyclique.

◆ RandomNum()

void RandomNum ( int Number)

Affiche un nombre aléatoire entre 1 et 6 sur le dé.

Parameters
NumberNombre à afficher.

Utilise le modulo pour garantir une valeur entre 1 et 6.

Parameters
NumberNombre à afficher.
Here is the call graph for this function: