codificacion en basic del programa del banco

October 15, 2017 | Autor: A. Yañez Juarez | Categoría: Physics Education
Share Embed


Descripción

CODIFICACION Device 16F877 XTAL 20 ALL_DIGITAL = true TRISA=$FF TRISB=$00 TRISC=$00 TRISD=$00 Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim

'* DECLARACION DE PUERTOS ENTRADA/SALIDA

a As Byte b As Byte c As Byte Deposito As Byte Cheque As Byte Promotor As Byte Taquilla As Byte i As Byte d As Byte e As Byte f As Byte v As Byte o As Byte

PORTB=0 PORTC=0 PORTD=0 b=32 c=66 i=0 d=0 e=32 f=66 a=0

'*

DECLARACION DE VARIABLES

'* INICIALIZACION DE PUERTOS '*

INICIALIZACION DE VARIABLES

Inicio: HRSOut "Universidad Experimental Politécnica de la Fuerza Armada Nacional Bolivariana",10,13 HRSOut "Practica No 2 ",10,13 HRSOut "Grupo 4",10,13 HRSOut "Alumnos:" ,10,13 HRSOut "Durán Astrid C.I:18.489.397",10,13 HRSOut "Graterol Jorge C.I:19.652.166",10,13 HRSOut "...............................................”,10,13 HRSOut "Servicio a utilizar”10,13 HRSOut "0.-Deposito y/o retiros en taquilla.",10,13 HRSOut "1.-Cheque.",10,13 HRSOut "2.-Promotor.",10,13 HRSOut "........................................................................ ........",10,13 Repeat HRSOut "Ingrese su opción= " HRSin Dec Deposito

HRSin Dec Cheque HRSin Dec Promotor Until Deposito=0, Cheque=1 or Promotor=2 Repeat PORTC.4=0 '* PULSADOR DE DEPOSITO EData Deposito,Cheque,Promotor,Taquilla '* MEMORIA EEPROM EWrite Deposito,[0] EWrite Cheque,[0] EWrite Promotor,[0] If PORTA.0=1 Then '* pulsador de deposito a=a+1 If a>32 Then a=0 End If If a66 Then b=32 End If

'* pulsador de cheque

If b>29 Then o=b+18 EWrite Cheque,[o] PORTB= ERead Cheque EndIf If b>39 Then

o=b+24 EWrite Cheque,[o] PORTB= ERead Cheque EndIf If b>49 Then o=b+30 EWrite Cheque,[o] PORTB= ERead Cheque EndIf If b>59 Then o=b+36 EWrite Cheque,[o] PORTB= ERead Cheque EndIf PORTC=0 PORTD=0 DelayMS 30 EndIf If PORTA.2=1 Then c=c+1 If c>99 Then c=66 End If

'* pulsador de promotor

If c>59 Then o=c+36 EWrite Promotor,[o] PORTB=ERead Promotor EndIf If c>69 Then o=c+42 EWrite promo,[o] PORTB= ERead Promotor EndIf If c>79 Then o=c+48 EWrite Promotor,[o] PORTB= ERead Promotor EndIf If c>89 Then o=c+54 EWrite Promotor,[o] PORTB= ERead Promotor EndIf PORTC=0 PORTD=0 DelayMS 30 EndIf If PORTA.3=1 Then i=i+1

'* PULSADOR DE TAQUILLA 1

If i19 Then o=d+12 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=1 PORTC=1 DelayMS 20 PORTB=0 PORTC.4=1 '* PARA APAGAR LOS DISPLAY PORTD=0 DelayMS 20 Next If d9 Then o=d+6 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>19 Then o=d+12 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=1 PORTD=1 If d=32 Then d=0 EndIf

EndIf If i>4 Then '* If i29 Then o=e+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=2 PORTD=1 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If e>29 Then o=e+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=2 PORTD=1

VISUALIZACIÓN DE SERVICIO DE TARJETA

If e=66 Then e=32 EndIf EndIf EndIf If i>7 Then If i59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=3 PORTD=1 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If f>59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54

'*

VISUALIZACIÓN DE PROMOTOR

EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=1 PORTC=3 If f=99 Then f=66 EndIf EndIf EndIf If i=9 Then i=0 EndIf EndIf If PORTA.4=1 Then i=i+1

'* PULSADOR DE TAQUILLA 2

If i19 Then o=d+12 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=2 PORTC=1 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If d9 Then

o=d+6 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>19 Then o=d+12 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=1 PORTD=2 If d=32 Then d=0 EndIf EndIf If i>4 Then If i29 Then o=e+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=2 PORTD=2 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If e>29 Then o=e+18

EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite taqui1,[o] PORTB= ERead taqui1 EndIf PORTC=2 PORTD=2 If e=66 Then e=32 EndIf EndIf EndIf If i>7 Then If i59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=3 PORTD=2 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0

DelayMS 20 Next If f>59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=2 PORTC=3 If f=99 Then f=66 EndIf EndIf EndIf If i=9 Then i=0 EndIf EndIf If PORTA.5=1 Then i=i+1

'* PULSADOR DE TAQUILLA 3

If i19 Then o=d+12

EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=3 PORTC=1 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If d9 Then o=d+6 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>19 Then o=d+12 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If d>29 Then o=d+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=1 PORTD=3 If d=32 Then d=0 EndIf EndIf If i>4 Then If i29 Then o=e+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla

EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=2 PORTD=3 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If e>29 Then o=e+18 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>39 Then o=e+24 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>49 Then o=e+30 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If e>59 Then o=e+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=2 PORTD=3 If e=66 Then e=32 EndIf EndIf EndIf If i>7 Then If i59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla

EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTC=3 PORTD=3 DelayMS 20 PORTB=0 PORTC.4=1 PORTD=0 DelayMS 20 Next If f>59 Then o=f+36 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>69 Then o=f+42 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>79 Then o=f+48 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf If f>89 Then o=f+54 EWrite Taquilla,[o] PORTB= ERead Taquilla EndIf PORTD=3 PORTC=3 If f=99 Then f=66 EndIf EndIf EndIf If i=9 Then i=0 EndIf

'* RETORNO A 0 DE LA VARIABLE i

EndIf GoTo inicio

'*

RETORNO A INICIO

SIMULACION

INICIALIZANDO

PULSANDO LA TAQUILLA UNO

PULSANDO LA TAQUILLA DOS

PULSANDO LA TAQUILLA TRES

Lihat lebih banyak...

Comentarios

Copyright © 2017 DATOSPDF Inc.