Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 3 Alimentation et réglage de la vitesse de l'hélice avec fonction
- //--------------------------------------------------------------
- //INCLUDES
- //--------------------------------------------------------------//
- #include <p33FJ256GP710.h>
- #include "CNAserie.h"
- #include "son.h"
- #include "lcd.h"
- #include "init.h"
- #include "clav.h"
- #include <math.h>
- //--------------------------------------------------------------
- //VARIABLES GLOBALES
- //--------------------------------------------------------------//
- void start(float rapportCyclique){
- PR2 = 4000; // Voir notes
- OC4CONbits.OCTSEL = 0; // Timer 2 is the clock for output compare
- OC4CONbits.OCM = 0b110; // PWM mode without fault protection
- OC4R = 0; // Pour commencer à 0 sur le graphe (voir notes)
- OC4RS = 4000*rapportCyclique; // Voir notes pour 1600. Permet de régler la vitesse.
- T2CONbits.TON = 1; // Lance le timer 2
- }
- int main(void) {
- //--------------------------------------------------------------
- //Définitions de vos variables
- //--------------------------------------------------------------
- //--------------------------------------------------------------
- //INITIALISATION DE LA CARTE
- //--------------------------------------------------------------
- init();
- Init_LCD();
- //--------------------------------------------------------------
- //ECRIRE ICI VOTRE CODE D'INITIALISATION DES PERIPHERIQUES
- //--------------------------------------------------------------//
- start(0.4);
- while (1) {
- //--------------------------------------------------------------
- //ROUTINE PRINCIPALE DU PROGRAMME
- //--------------------------------------------------------------//
- //----------------------------------
- //Fonction longue permettant d'écrire sur le LCD, laisser en commentaire sauf demande contraire dans l'énoncé
- //----------------------------------
- //clav2LCD();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement