forked from t-edson/PicPas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram_PicPas.txt
57 lines (54 loc) · 1.43 KB
/
program_PicPas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
////////////////////////////////////////////////////////////////////////////////////
// VsZeNeR"04
// 7/Agosto/05
//
// Programa: Coche Fantastico
// Version: 0.0
//
// Dispositivo: PIC 16F648A Compilador: CCS vs3.227
// Entorno IDE: MPLAB IDE v7.20 Simulador: Proteus 6.7sp3
//
// Notas: Barrido de led"s simulando la iluminacion del coche fantastico por el
// puerto A
//
// RA0 -> 1º Led
// RA1 -> 2º Led
// RA2 -> 3º Led
// RA3 -> 4º Led
// Fuente: http://www.todopic.com.ar/foros/index.php?topic=4530.msg38857#msg38857
//////////////////////////////////////////////////////////////////////////////////
program Coche;
{$PROCESSOR PIC16F84}
uses PIC16F84A;
procedure derecha;
begin
PORTA.0 := 1;
delay_ms(300);
PORTA.0 := 0;
PORTA.1 := 1;
delay_ms(300);
PORTA.1 := 0;
PORTA.2 := 1;
delay_ms(300);
PORTA.2 := 0;
PORTA.3 := 1;
delay_ms(300);
end;
procedure izquierda;
begin
PORTA.3 := 0;
PORTA.2 := 1;
delay_ms(300);
PORTA.2 := 0;
PORTA.1 := 1;
delay_ms(300);
PORTA.1 := 0;
end;
begin
TRISA := $F0; //porta como salida menos RA4(desactivado)
INTCON_GIE := 0; //todas las interrupciones desactivadas
while true do //bucle...
derecha;
izquierda;
end; //...infinito
end.