First commit
This commit is contained in:
36
IUT/Info2/TP/Chap2/chapitre4/chap4t/Sources/main.c
Normal file
36
IUT/Info2/TP/Chap2/chapitre4/chap4t/Sources/main.c
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <hidef.h>
|
||||
#include "derivative.h"
|
||||
#include "tempo.h"
|
||||
|
||||
int i;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
/* Internal clock of 8MHz selected. */
|
||||
ICSC2 = 0x00;
|
||||
ICSC1 = 0x04;
|
||||
|
||||
SOPT1_COPE = 0; /* Disable Watchdog */
|
||||
|
||||
PTBDD = 0xFF;
|
||||
|
||||
/* include your code here */
|
||||
for (;;)
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
// tempo(0, 51872); // 500ms
|
||||
PTBD |= 0b1 << i;
|
||||
tempo(2, 51872); // 500ms
|
||||
PTBD = 0;
|
||||
}
|
||||
|
||||
} /* loop forever */
|
||||
}
|
||||
|
||||
void interrupt 7 Depassement_compteur(void)
|
||||
{
|
||||
|
||||
|
||||
TPMSC = TPMSC & 0b01111111;
|
||||
}
|
||||
Reference in New Issue
Block a user