Vous êtes sur la page 1sur 25

ESCUELA SUPERIOR POLITÉCNICA DEL LITORAL

FACULTAD DE INGENIERÍA EN ELECTRICIDAD Y COMPUTACIÓN

Proyecto de Graduación

Diseño e implementación de un sistema Inalámbrico de Alarma


Domiciliaria con alerta vía celular

Contenido
Código fuente en lenguaje Basic de los microcontroladores PIC16F628 y
PIC18F4550 comprendidos en los bloques Alarma y Controlador
respectivamente

Autores
Jorge Galarza Rosas – Titulo Ing. Telemático
Ricardo Cajo Díaz– Titulo Ing. Electrónica y Telecomunicaciones

Índice
Consola GSM…………………………………………………………………….……………………..2
Alarma Puerta…………………………………………………………………………………………19
Alarma Movimiento………………………………………………………………………………..22
Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

1: program ConsolaGSM
2: '***************************DECLARACION DE VARIABLES****************************
3: Dim kp,received_byte,viajero,alert_alarma,cod_alarma, Estado_Alarma,acknoledge,
num_telf as byte
4: Dim checksun_recibido,checksun_calculado as byte
5: dim claveInicial,ClaveIngresada,Codigos_Alarmas,Codigos as byte[6] ' clave de 5
digitos
6: dim bte_old_pass,bte_new_pass,bte_rep_pass , dato as byte[6]
7: dim bandera_oldPass,bandera_newPass,bandera_repPass as byte
8: dim i,ind_clave,opcion,bandera,veces as byte
9: dim txt_numero as char[16]
10: dim txt_numero_p as char[16]
11: dim txt_clave as char[7]
12: dim txt_codigo as char[4]
13: dim str_cadena as char[4]
14: dim str_numero_convertido as char[3]
15: dim bte_numero_add as byte[10]
16:
17: '*****************************CONSTANTES****************************************
18: const esc = $23 'ESC/CANCEL esta Tecla sirve para salir o para CANCELAR OJO
19: const enter = $70
20: const INICIO = $24
21: const ID = $49
22: const FIN = $46
23: '*********************************ESTRUCTURAS***********************************
*
24: structure Telf_Usuarios
25: dim Telf as string[10][9]
26: end structure
27:
28: dim Telefonos as Telf_Usuarios
29:
30: '*******************************INTERRUPCION************************************
31: sub procedure interrupt()
32:
33: ' Usart_Data_Ready es lo mismo que haber puesto PIR1.RCIF
34: if Usart_Data_Ready = 1 then
35: received_byte = Usart_Read
36: select case viajero
37:
38: case 0
39: if (received_byte=INICIO) then '$'
40: porta.0=0
41: viajero=1
42: else
43: viajero=0
44: end if
45:
46: case 1
47: if (received_byte=ID) then 'I' ID
48: viajero=2
49: else
50: viajero=0
51: end if
52:
53: case 2
54: dato[0]=(received_byte) 'Codigo Alarma
55: viajero=3
56: case 3
57: dato[1]= received_byte 'Estado Alarma

2/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

58: viajero=4
59: case 4
60: dato[2]= received_byte 'Alerta Alarma
61: viajero=5
62: case 5
63: dato[3]= received_byte 'acknoledge
64: viajero=6
65: case 6
66: dato[4]= received_byte 'checksun_recibido
67: checksun_recibido =dato[4]
68: viajero=7
69: case 7
70: dato[5]=received_byte
71: if(dato[5]= FIN)then 'F' STOP
72: checksun_calculado = dato[0]+dato[1]+dato[2]+dato[3]
73: if(checksun_calculado = checksun_recibido )then
74: cod_alarma=dato[0]
75: Estado_Alarma=dato[1]
76: alert_alarma =dato[2]
77: acknoledge=dato[3]
78: viajero=0
79: else
80: viajero=0
81: end if
82: else
83: viajero=0
84: end if
85: end select
86:
87: end if
88: PIR1.RCIF=0 ' Si el dato a llegado limpio la bandera de recepcion
89: PIE1.RCIE=1 ' Habilitar nuevamente la interrupcion por USART
90: end sub
91:
92: '****************************ENVIAR MENSAJES GSM********************************
93: sub procedure enviar_sms(dim byref Telefonos as Telf_Usuarios,dim i as byte,dim
byref texto as string[40])
94: dim j as byte
95: dim k as Byte
96:
97: for j = 0 to i-1
98:
99: Usart_Write_Text("AT+CMGF=1")
100: Usart_Write(10)
101: Usart_Write(13)
102: delay_ms(1000)'500
103: Usart_Write_Text("AT+CMGS=")
104: Usart_Write(34)' "
105: Usart_Write_Text(Telefonos.Telf[j])
106: Usart_Write(34)' "
107: Usart_Write(10)
108: Usart_Write(13)
109: delay_ms(1000)
110:
111: for k = 0 to Strlen(texto)-1
112: Usart_Write(texto[k])
113: next k
114:
115: Usart_Write(26)
116: Usart_Write(10)

3/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

117: Usart_Write(13)
118: delay_ms(8000)'8000
119: next j
120: texto=""
121:
122: end sub
123: '************************FUNCION LEER TECLADO**********************************
124: sub procedure leer_teclado()
125: kp = 0
126: portb.0=0
127: portb.1=1
128: portb.2=1
129: portb.3=1
130: '' portb=%11111110
131: if(portb.4=0)then
132: while(portb.4=0) wend
133: kp=$31 end if'1
134: if(portb.5=0)then
135: while(portb.5=0) wend
136: kp=$32 end if'2
137: if(portb.6=0)then
138: while(portb.6=0) wend
139: kp=$33 end if'3
140: if (portb.7=0)then
141: while(portb.7=0) wend
142: kp=$41 end if'A
143: if(kp=0)then
144: portb.0=1
145: portb.1=0
146: portb.2=1
147: portb.3=1
148: ''portb=%11111101
149: if(portb.4=0)then
150: while(portb.4=0) wend
151: kp=$34 end if'4
152: if(portb.5=0)then
153: while(portb.5=0) wend
154: kp=$35 end if'5
155: if(portb.6=0)then
156: while(portb.6=0) wend
157: kp=$36 end if'6
158: if (portb.7=0)then
159: while(portb.7=0) wend
160: kp=$42 end if'B
161: else return
162: end if
163: if(kp=0) then
164: portb.0=1
165: portb.1=1
166: portb.2=0
167: portb.3=1
168:
169: ''=%111101011
170: if(portb.4=0)then
171: while(portb.4=0) wend
172: kp=$37 end if'7
173: if(portb.5=0)then
174: while(portb.5=0) wend
175: kp=$38 end if'8
176: if(portb.6=0)then

4/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

177: while(portb.6=0) wend


178: kp=$39 end if'9
179: if (portb.7=0)then
180: while(portb.7=0) wend
181: kp=$43 end if'C
182: else return
183: end if
184: if(kp=0)then
185: portb.0=1
186: portb.1=1
187: portb.2=1
188: portb.3=0
189: ''portb=%11110111
190: if(portb.4=0)then
191: while(portb.4=0) wend
192: kp=$23 end if'esc
193: if(portb.5=0)then
194: while(portb.5=0) wend
195: kp=$30 end if'0
196: if(portb.6=0)then
197: while(portb.6=0) wend
198: kp=$70 end if'enter <-
199: if (portb.7=0)then
200: while(portb.7=0) wend
201: kp=$44 end if'D
202: else return
203: end if
204:
205: end sub
206: '***************************MOSTRAR MENSAJE LCD*********************************
207: sub procedure ShowMessage(dim fil,col as byte,dim delayms as word,dim byref msg
as string[16])
208: Lcd_Cmd(LCD_CLEAR)
209: Lcd_Out(fil, col,msg)
210: VDelay_ms(delayms)
211: end sub
212: '**********************GUARDAR PASSWORD*****************************************
213: sub procedure SavePassword(dim byref clave as byte[6] )
214: for i=0 to 4
215: EEprom_write(i,clave[i])
216: delay_ms(25)
217: next i
218: end sub
219: '********************OBTENER NUMERO TELEFONICO DESDE EEPROM*********************
220: sub procedure GetFono(dim byref strText as char[16], dim pos as byte)
221: dim numeroObtenido,j as byte
222: dim txt_save as char[9][3]
223: dim valor_inicio,valor_fin as byte
224:
225: for j=0 to 8
226: txt_save[j][2] = " "
227: next j
228: numeroObtenido=0
229:
230: valor_inicio = 176 + (pos -1)*8
231: valor_fin = valor_inicio +7
232: for j=valor_inicio to valor_fin
233: numeroObtenido = EEprom_read(j)
234: if numeroObtenido = 255 then return end if
235: ByteToStr(numeroObtenido,txt_save[j-valor_inicio+1])

5/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

236: next j
237:
238: for j = 1 to 8
239: strText[j]=txt_save[j][2]
240: next j
241: strText[0]="0"
242: end sub
243: '********************OBTENER CODIGO DE ALARMA DESDE EEPROM*********************
244: sub procedure GetCode(dim byref Codigo as byte[6], dim pos as byte)
245: dim numeroObtenido,j as byte
246: dim valor_inicio,valor_fin as byte
247: numeroObtenido=0
248:
249: valor_inicio = 64 + (pos -1)*8
250: valor_fin = valor_inicio +1
251: for j=valor_inicio to valor_fin
252: numeroObtenido = EEprom_read(j)
253: delay_ms(30)
254: Codigo[j-valor_inicio]=numeroObtenido
255: next j
256:
257: end sub
258: '*************************SETEAR ARREGLO****************************************
259: sub procedure SetStr(dim byref strText as char[16], dim caracter as string,dim
tamano as byte)
260: dim j as byte
261: for j=0 to tamano-1
262: strText[j] = caracter
263: next j
264: end sub
265: '**********************GUARDAR NUMERO DE TELEFONO EN EEPROM*********************
266: sub function SaveEprom_Number(dim byref number as byte[9]) as boolean
267: dim estado as boolean
268: dim cont as byte
269: dim num as byte
270: dim j as word
271: estado=1 cont =1 j=176
272: while j<=255
273: Delay_ms(30)
274: num=EEprom_read(j)
275: Delay_ms(30)
276: if num<>$FF then
277: j= j+7
278: else
279: EEprom_write(j,number[cont])
280: Inc(cont)
281: end if
282: if (cont = 9) then
283: result = estado
284: return
285: end if
286: inc(j)
287: wend
288: result=0
289: end sub
290: '**********************GUARDAR CODIGO DE ALARMA EN EEPROM *********************
291: sub function SaveEprom_Code(dim byref code as byte[9]) as boolean
292: dim estado as boolean
293: dim cont as byte
294: dim num as byte

6/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

295: dim j as word


296: estado=1 cont =0 j=64
297: while j<=143
298: Delay_ms(30)
299: num=EEprom_read(j)
300: Delay_ms(30)
301: if num<>$FF then
302: j= j+7
303: else
304: EEprom_write(j,code[cont])
305: Inc(cont)
306: end if
307: if (cont = 2) then
308: result = estado
309: return
310: end if
311: inc(j)
312: wend
313: result=0
314: end sub
315: '**********************BORRAR NUMERO DE TELEFONO DESDE EEPROM*******************
316: sub procedure DeleteEprom_Number(dim addres as byte , dim pos as byte)
317: dim valor_inicio,valor_fin as byte
318: valor_inicio = addres + (pos -1)*8
319: valor_fin = valor_inicio +7
320: for i=valor_inicio to valor_fin
321: EEprom_write(i,$FF)
322: delay_ms(30)
323: next i
324: end sub
325: '*********************************INDICADOR*************************************
326: sub procedure led()
327: PORTA.0=1
328: delay_ms(200)
329: PORTA.0=0
330: delay_ms(200)
331: PORTA.0=1
332: delay_ms(200)
333: PORTA.0=0
334: delay_ms(200)
335: PORTA.0=1
336: end sub
337: '*****************************DESPLAZAR MENU************************************
338: sub procedure DesplazarMenu()
339: if(porta.1=1)then
340: while(porta.1=1) wend
341: if(opcion=7) then
342: opcion=1
343: else
344: inc(opcion)
345: end if
346: end if
347: if(porta.2=1)then
348: while(porta.2=1) wend
349: if(opcion=1)then
350: opcion=7
351: else
352: dec(opcion)
353: end if
354: end if

7/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

355: end sub


356: '****************************DESPLAZAR NUMEROS**********************************
357: sub procedure DesplazarNumeros()
358: if(porta.1=1)then
359: while(porta.1=1) wend
360: veces=0
361: if(opcion=10) then
362: opcion=1
363: else
364: inc(opcion)
365: end if
366: end if
367: if(porta.2=1)then
368: while(porta.2=1) wend
369: veces=0
370: if(opcion=1)then
371: opcion=10
372: else
373: dec(opcion)
374: end if
375: end if
376: end sub
377: '********************************VALIDAR CLAVE**********************************
378: sub function validar_clave(dim byref clave,clv as byte[6],dim digitos as byte)
as boolean
379: dim estado as boolean
380: if digitos=5 then
381: estado=1
382: for i=0 to 4
383: estado = ((clave[i]) = (clv[i]))and estado
384: next i
385: result=estado
386: else
387: result=0
388: end if
389: end sub
390: '****************ENVIA TRAMA DE ACTIVACION O DESACTIVACION DE ALARMAS***********
391: sub procedure Enviar_Trama_Alarma(dim code as byte,dim estado as byte,dim
respuesta as byte)
392: checksun_calculado =code + estado + respuesta
393: USART_Write (INICIO)
394: USART_Write (ID)
395: USART_Write (code)
396: USART_Write (estado)
397: USART_Write (respuesta)
398: USART_Write (checksun_calculado)
399: Usart_Write (FIN)
400: end sub
401:
402: '***************************VERIFICAR ALERTA DE ALARMA**************************
403: sub procedure Verificar_Alerta_Alarma()
404: if(alert_alarma =1)then
405: Enviar_Trama_Alarma (cod_alarma,1,1) 'Envio respuesta de Acknoledge
406: led()
407: num_telf =0
408: SetStr (txt_numero_p ," ",9)
409: for i=1 to 10
410: GetFono(txt_numero_p,i)
411: if(txt_numero_p[1]<>" ")then
412: strcpy(Telefonos.Telf[num_telf],txt_numero_p )

8/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

413: inc(num_telf)
414: end if
415: SetStr (txt_numero_p ," ",9)
416: next i
417: if(num_telf>0) then
418: enviar_sms (Telefonos ,num_telf ,"Alerta Alarma" )
419: end if
420: alert_alarma=0
421: end if
422: end sub
423: '****************ENVIA TRAMA DE ACTIVACION O DESACTIVACION DE ALARMAS***********
424: sub procedure Activar_Desactivar_Alarmas(dim estado as byte)
425: dim indicador ,cont as byte
426: indicador=0
427: acknoledge=0
428: cont=0
429: led()
430: num_telf =0
431: for i=1 to 10
432: GetCode(Codigos_Alarmas ,i)
433: if(Codigos_Alarmas [0]<>$FF)then
434: Codigos[num_telf]=(Codigos_Alarmas[0]*10) + Codigos_Alarmas[1]
435: inc(num_telf)
436: end if
437: next i
438: if(num_telf>0) then
439: while(num_telf>0)
440: if(indicador=0)then
441: dec(num_telf)
442: Enviar_Trama_Alarma(Codigos[num_telf],estado,acknoledge)
443: end if
444: Delay_ms(1000)
445: if(acknoledge =1)then
446: indicador=0
447: acknoledge =0
448: cont=0
449: else
450: inc(cont)
451: if(cont<5)then
452: num_telf =num_telf +1
453: else cont=0
454: end if
455: indicador=0
456: end if
457: wend
458:
459: end if
460:
461: end sub
462: '***************************PROGRAMA PRINCIPAL**********************************
463: main:
464:
465: ''RCON.7=0
466: INTCON = %11000000 'habilito int globales y periferifericos int
467: ADCON0=0
468: ADCON1 =$0F 'digital input
469:
470: INTCON2=$00
471: PIE1=%00100000
472: PIR1=0

9/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

473: IPR1=%00100000
474: CMCON= $07
475: '' T1CON =$31 'preescalador (8)
476: ''TMR1H = $3C ' 10ms
477: ''TMR1L = $AF '(Prescaler=8)*(2^16 -$0BDB)*(4/Fosc) = 500ms
478:
479: TRISA = $0E ' PORTB is output
480: TRISC = $80 ' PORTB is output
481: TRISB = $F0
482: TRISD = $00
483: TRISE= $00
484: PORTC=0
485: PORTE=0
486: PORTD=0
487: alert_alarma =0
488: cod_alarma=0
489: viajero=0
490: acknoledge=0
491: veces=0
492: i=0
493: ind_clave=0
494: Usart_Init(9600)
495:
496: Usart_Write_Text("Inicio Alarma GSM")
497: Lcd_Config(PORTD,3,2,1,0,PORTE,0,1,2)
498: Lcd_Cmd(Lcd_CURSOR_OFF)
499: led()
500: '**************************** CLAVE DEFAULT ***********************************
501: claveInicial[0]= 1
502: claveInicial[1]= 2
503: claveInicial[2]= 3
504: claveInicial[3]= 4
505: claveInicial[4]= 5
506:
507: if (portA.3 = 1) then
508: for i=0 to 4
509: EEprom_write(i,claveInicial[i])
510: delay_ms(30)
511: next i
512: '' SavePassword (claveInicial)
513: led()
514: end if
515: '***************************** INICIO ******************************************
516: INICIO:
517: LCD_Cmd(LCD_CLEAR)
518: txt_clave =""
519: Delay_ms(500)
520: Lcd_Out(1, 1," ALARMA GSM ")
521: Lcd_Out(2, 1,"PASSWORD:")
522: ind_clave=0
523: SetStr (txt_clave ," ",7)
524: while true
525: leer_teclado()
526: if kp = esc then
527: ind_clave=0
528: goto INICIO '**
529: end if
530: if kp =enter then 'Tecla ENTER
531: led()
532: Lcd_Cmd(LCD_CLEAR)

10/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

533: for i=0 to 4


534: claveInicial[i]=EEprom_read(i)
535: Delay_ms(30)
536: next i
537:
538: if validar_clave(claveInicial,ClaveIngresada,ind_clave)=1 then
539: led()
540: opcion=1
541: ind_clave=0
542: goto MENU
543: else
544: Lcd_Out(2, 7,"ERROR")
545: delay_ms(500)
546: Lcd_Cmd(LCD_CLEAR)
547: ind_clave=0
548: goto INICIO
549: end if
550: end if
551: if (kp = $43) and (ind_clave>0) then 'Tecla DELETE
552: dec(ind_clave)
553: txt_clave [ind_clave]=" "
554: Lcd_Out(2,10,txt_clave )
555: end if
556:
557:
558: if (kp >=$30) and (kp <= $39)and (ind_clave<5) then
559: txt_clave [ind_clave]= "*"
560: ClaveIngresada[ind_clave]=kp-48
561: Delay_ms(20)
562: Lcd_Out(2,10,txt_clave )
563: inc(ind_clave) 'contador de digitos ingresados
564: Delay_ms(20)
565: end if
566: 'Verificar_Alerta_Alarma()
567: wend
568: '********************************** MENU ***************************************
569: MENU:
570: LCD_Cmd(LCD_CLEAR)
571: Lcd_Out(1, 1," BIENVENIDOS ")
572: Delay_ms(500)
573: opcion=1
574: ind_clave=0
575: while True
576: leer_teclado()
577: DesplazarMenu()
578: if kp = esc then
579: ind_clave=0
580: goto INICIO '**
581: end if
582: Lcd_Out(1, 1," ALARMA GSM ")
583: select case opcion
584: case 1
585: Lcd_Out(2, 1,"1 TURN ON ALARM ")
586: if(kp=enter) then goto TurnOnAlarm end if
587: case 2
588: Lcd_Out(2, 1,"2 TURN OFF ALARM")
589: if(kp=enter) then goto TurnOffAlarm end if
590: case 3
591: Lcd_Out(2, 1,"3 ADD ALARM ")
592: if(kp=enter) then goto AddAlarm end if

11/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

593: case 4
594: Lcd_Out(2, 1,"4 DELETE ALARM ")
595: if(kp=enter) then goto DeleteAlarm end if
596: case 5
597: Lcd_Out(2, 1,"5 ENTER NUMBER ")
598: if(kp=enter) then goto EnterNumber end if
599: case 6
600: Lcd_Out(2, 1,"6 DELETE NUMBER ")
601: if(kp=enter) then goto DeleteNumber end if
602: case 7
603: Lcd_Out(2, 1,"7 CHANGE PASSWOR")
604: ' if(kp=enter) then goto ChangePassword end if
605: end select
606: Verificar_Alerta_Alarma()
607: wend
608: '************************** OPCION 1 TURN ON ALARM******************************
609: TurnOnAlarm:
610: LCD_Cmd(LCD_CLEAR)
611: Lcd_Out(1, 1,"1 TURN ON ALARM ")
612: Lcd_Out(2, 1," PRESS ENTER ")
613: while True
614: leer_teclado()
615:
616: if kp = esc then
617: ind_clave=0
618: goto MENU '**
619: end if
620:
621: if(kp=enter) then
622: ShowMessage(2,1,0,"WAIT PLEASE.....")
623: Activar_Desactivar_Alarmas(1)
624: ShowMessage(2,1,1000,"WAIT PLEASE.....")
625: goto MENU
626: end if
627:
628: wend
629: '''************************** OPCION 2 TURN OFF
ALARM*****************************
630: TurnOffAlarm:
631: LCD_Cmd(LCD_CLEAR)
632: Lcd_Out(1, 1,"1 TURN OFF ALARM")
633: Lcd_Out(2, 1," PRESS ENTER ")
634: while True
635: leer_teclado()
636:
637: if kp = esc then
638: ind_clave=0
639: goto MENU '**
640: end if
641: if(kp=enter) then
642: ShowMessage(2,1,0,"WAIT PLEASE.....")
643: Activar_Desactivar_Alarmas(0)
644: ShowMessage(2,1,1000,"WAIT PLEASE.....")
645: goto MENU
646: end if
647:
648: wend''************************** OPCION 3 ADD
ALARM**********************************
649: AddAlarm:
650: ind_clave=0

12/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

651: bandera=0
652: LCD_Cmd(LCD_CLEAR)
653: Lcd_Out(1,1," ENTER CODE: ")
654: SetStr(txt_numero," ",16)
655: while True
656: leer_teclado()
657:
658: if (kp >=$30) and (kp <= $39) and (ind_clave<2)then
659: bte_numero_add[ind_clave] = kp - 48
660: txt_numero[ind_clave]= kp
661: Lcd_Out(2,1,txt_numero)
662: inc(ind_clave) 'contador de digitos ingresados
663: end if
664:
665: if (kp = esc) and (bandera=0) then
666: goto MENU '**
667: end if
668:
669: if (kp = $43) and (ind_clave>0) and (bandera=0) then 'Tecla DELETE
670: dec(ind_clave)
671: txt_numero[ind_clave]=" "
672: Lcd_Out(2,1,txt_numero)
673: end if
674:
675: if (kp = esc) and (bandera=1) then 'Estan en YES/CANCEL presiono cancel
vuelve a mostrar el numero
676: ShowMessage(1,1,0," ENTER CODE: ")
677: Lcd_Out(2,1,txt_numero)
678: bandera=0
679: end if
680:
681: if (kp=enter) and (ind_clave<2) then
682: ShowMessage(1,1,500,"CODE INCOMPLETO")
683: ShowMessage(1,1,0," ENTER CODE: ")
684: Lcd_Out(2,1,txt_numero)
685: end if
686:
687: if (kp=enter) and (ind_clave=2) then
688: LCD_Cmd(LCD_CLEAR)
689: Lcd_Out(1,1,"Add #:")
690: Lcd_Out(1,7,txt_numero)
691: Lcd_Out(1,9,"?")
692: Lcd_Out(2,1," YES/CANCEL")
693: bandera=1
694: end if
695:
696: if (kp=$44) and (bandera=1) then'Tecla YES
697: ShowMessage(2,1,0," SAVING...")
698: if SaveEprom_Code (bte_numero_add )=1 then
699: ShowMessage(2,1,500," SAVED OK")
700: else
701: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
702: Delay_ms(500) LCD_Cmd(LCD_CLEAR) Delay_ms(200)
703: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
704: Delay_ms(500) LCD_Cmd(LCD_CLEAR) Delay_ms(200)
705: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
706: Delay_ms(500)
707: end if
708: goto MENU
709: end if

13/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

710: wend
711: ''************************** OPCION 4 DELETE
ALARM*******************************
712: DeleteAlarm:
713: LCD_Cmd(LCD_CLEAR)
714: Lcd_Out(1, 1,"4 DELETE ALARM ")
715: opcion=1
716: bandera=0
717: veces=0
718: while true
719: leer_teclado()
720: DesplazarNumeros()
721: if (kp = esc) and (bandera=0) then
722: ind_clave=0
723: goto MENU '**
724: end if
725: if (bandera=0) and (veces=0) then
726: SetStr(txt_codigo," ",4)
727: SetStr(str_cadena ," ",4)
728: ByteToStr(opcion,str_numero_convertido)
729: if opcion = 10 then str_cadena[0] = "1" else str_cadena[0] = "0" end if
730: str_cadena[1] = str_numero_convertido[2]
731: str_cadena[2] = "."
732: str_cadena[3] = "-"
733: Lcd_Out(2, 1,str_cadena)
734: GetCode(Codigos_Alarmas,opcion)
735: if(Codigos_Alarmas [0]<>$FF)then
736: Codigos[0] =(Codigos_Alarmas[0]*10)+Codigos_Alarmas[1]
737: ByteToStr(Codigos[0] ,txt_codigo)
738: end if
739: end if
740:
741: if (txt_codigo[2]=" ") and (veces=0) then
742: Lcd_Out(2, 5," ")
743: Lcd_Out(2, 6,"(VACIO) ")
744: veces=1
745: end if
746:
747: if (txt_codigo [2]<>" ") and (bandera=0)and (veces=0) then
748: Lcd_Out(2, 5," ")
749: Lcd_Out(2, 6,"Code:" )
750: Lcd_Out(2, 11,txt_codigo )
751: Lcd_Out(2, 14," " )
752: veces=1
753: end if
754:
755: if (kp = $43) and (txt_codigo [2]<>" ") then 'Tecla DELETE
756: LCD_Cmd(LCD_CLEAR)
757: Lcd_Out(1,1,"DEL ALARM #:")
758: Lcd_Out(1,13,txt_codigo )
759: Lcd_Out(1,16,"?")
760: Lcd_Out(2,1," YES/CANCEL")
761: bandera=1
762: end if
763:
764: if (kp=$44) and (bandera=1) then'Tecla YES
765: DeleteEprom_Number(64,opcion)
766: LCD_Cmd(LCD_CLEAR)
767: Lcd_Out(2,1," DELETING...")
768: LCD_Cmd(LCD_CLEAR)

14/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

769: Lcd_Out(2,1," DELETE OK...")


770: Delay_ms(500)
771: goto MENU
772: end if
773:
774: if (kp = esc) and (bandera=1) then
775: goto DeleteAlarm '**
776: end if
777:
778: wend'************************** OPCION 5 ENTER NUMBER
******************************
779: EnterNumber:
780: ind_clave=0
781: bandera=0
782: txt_numero=""
783: LCD_Cmd(LCD_CLEAR)
784: Lcd_Out(1,1," ENTER NUMBER: ")
785: SetStr(txt_numero," ",16)
786:
787: while True
788: leer_teclado() 'Lee del Teclado y se guarda en kp
789:
790: if (kp >=$30) and (kp <= $39) and (ind_clave<9)then
791: bte_numero_add[ind_clave] = kp - 48
792: txt_numero[ind_clave]= kp
793: Lcd_Out(2,1,txt_numero)
794: inc(ind_clave) 'contador de digitos ingresados
795: end if
796:
797: if (kp = esc) and (bandera=0) then
798: goto MENU '**
799: end if
800:
801: if (kp = $43) and (ind_clave>0) and (bandera=0) then 'Tecla DELETE
802: dec(ind_clave)
803: txt_numero[ind_clave]=" "
804: Lcd_Out(2,1,txt_numero)
805: end if
806:
807: if (kp = esc) and (bandera=1) then 'Estan en YES/CANCEL presiono cancel
vuelve a mostrar el numero
808: ShowMessage(1,1,0," ENTER NUMBER: ")
809: Lcd_Out(2,1,txt_numero)
810: bandera=0
811: end if
812:
813: if (kp=enter) and (ind_clave<9) then
814: ShowMessage(1,1,500,"NUMERO INCOMPLETO")
815: ShowMessage(1,1,0," ENTER NUMBER: ")
816: Lcd_Out(2,1,txt_numero)
817: end if
818:
819: if (kp=enter) and (ind_clave=9) then
820: LCD_Cmd(LCD_CLEAR)
821: Lcd_Out(1,1,"Add #:")
822: Lcd_Out(1,7,txt_numero)
823: Lcd_Out(1,16,"?")
824: Lcd_Out(2,1," YES/CANCEL")
825: bandera=1
826: end if

15/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

827:
828: if (kp=$44) and (bandera=1) then'Tecla YES
829: ShowMessage(2,1,0," SAVING...")
830: if SaveEprom_Number(bte_numero_add)=1 then
831: ShowMessage(2,1,500," SAVED OK")
832: else
833: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
834: Delay_ms(500) LCD_Cmd(LCD_CLEAR) Delay_ms(200)
835: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
836: Delay_ms(500) LCD_Cmd(LCD_CLEAR) Delay_ms(200)
837: Lcd_Out(1,1," SAVE ERROR ") Lcd_Out(2,1," MEMORY FULL ")
838: Delay_ms(500)
839: end if
840: goto MENU
841: end if
842: wend
843: '************************** OPCION 6 DELETE NUMBER *****************************
844: DeleteNumber:
845: LCD_Cmd(LCD_CLEAR)
846: Lcd_Out(1, 1," DELETE NUMBER ")
847: SetStr(txt_numero_p," ",16)
848: opcion=1
849: bandera=0
850: veces=0
851: while true
852: leer_teclado()
853: DesplazarNumeros()
854:
855: if (kp = esc) and (bandera=0) then
856: ind_clave=0
857: goto MENU '**
858: end if
859:
860: if (bandera=0) and (veces=0) then
861: SetStr(txt_numero_p," ",16)
862: SetStr(str_cadena ," ",4)
863: ByteToStr(opcion,str_numero_convertido)
864: if opcion = 10 then str_cadena[0] = "1" else str_cadena[0] = "0" end if
865: str_cadena[1] = str_numero_convertido[2]
866: str_cadena[2] = "."
867: str_cadena[3] = "-"
868: Lcd_Out(2, 1,str_cadena)
869: GetFono(txt_numero_p,opcion)
870:
871: end if
872:
873: if (txt_numero_p[1]=" ") AND (veces=0) then
874: Lcd_Out(2, 5," ")
875: Lcd_Out(2, 6,"(VACIO) ")
876: Delay_ms(1)
877: veces=1
878: end if
879:
880: if (txt_numero_p[1]<>" ") and (bandera=0) AND (veces=0) then
881: Lcd_Out(2, 5," ")
882: Lcd_Out(2, 6,txt_numero_p)
883: Lcd_Out(2, 15," ")
884: Delay_ms(1)
885: veces=1
886: end if

16/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

887:
888: if (kp = $43) and (txt_numero_p[1]<>" ") then 'Tecla DELETE
889: LCD_Cmd(LCD_CLEAR)
890: Lcd_Out(1,1,"DEL #:")
891: Lcd_Out(1,7,txt_numero_p)
892: Lcd_Out(1,16,"?")
893: Lcd_Out(2,1," YES/CANCEL")
894: bandera=1
895: end if
896:
897: if (kp=$44) and (bandera=1) then'Tecla YES
898: DeleteEprom_Number(176,opcion)
899: LCD_Cmd(LCD_CLEAR)
900: Lcd_Out(2,1," DELETING...")
901: LCD_Cmd(LCD_CLEAR)
902: Lcd_Out(2,1," DELETE OK...")
903: Delay_ms(500)
904: goto MENU
905: end if
906:
907: if (kp = esc) and (bandera=1) then
908: goto DeleteNumber '**
909: end if
910:
911: wend
912: ************************** OPCION 7 CHANGE PASSWORD ***************************
913: ChangePassword:
914: ind_clave=0 bandera_oldPass =1 bandera_newPass =0 bandera_repPass =0
915: LCD_Cmd(LCD_CLEAR)
916: Lcd_Out(1,1,"OLD PASS:")
917: SetStr(txt_numero," ",16)
918: Lcd_Out(2,1,txt_numero)
919: while True
920: leer_teclado() 'Lee del Teclado y se guarda en kp
921: if (kp >=$30) and (kp <= $39) and (ind_clave<5) then
922: txt_numero[ind_clave]= "*"
923: if bandera_oldPass =1 then
924: bte_old_pass[ind_clave] = kp - 48
925: Lcd_Out(2,1,txt_numero) end if
926: if bandera_newPass =1 then
927: bte_new_pass[ind_clave] = kp - 48
928: Lcd_Out(1,11,txt_numero) end if
929: if bandera_repPass =1 then
930: bte_rep_pass[ind_clave] = kp - 48
931: Lcd_Out(2,11,txt_numero) end if
932: inc(ind_clave) 'contador de digitos ingresados
933: end if
934:
935: if kp = esc then goto MENU end if 'Presiona ESC
936:
937: if (kp = $43) and (ind_clave>0) then 'Tecla DELETE
938: dec(ind_clave)
939: txt_numero[ind_clave]=" "
940: if bandera_oldPass =1 then Lcd_Out(2,1,txt_numero) end if
941: if bandera_newPass =1 then Lcd_Out(1,11,txt_numero) end if
942: if bandera_repPass =1 then Lcd_Out(2,11,txt_numero) end if
943: end if
944:
945: if (kp=enter) and (bandera_oldPass =1) then
946: Lcd_Cmd(LCD_CLEAR)

17/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Consola GSM Autores: Ricardo Cajo - Jorge Galarza

947: for i=0 to 4


948: claveInicial[i]=EEprom_read(i)
949: next i
950:
951: if validar_clave(claveInicial,bte_old_pass,ind_clave)=1 then
952: led()
953: Lcd_Out(1, 1,"NEW PASS:")
954: ind_clave=0 bandera_oldPass =0 bandera_newPass =1
bandera_repPass =0
955: SetStr(txt_numero," ",16)
956: else
957: ShowMessage(2,7,500,"ERROR")
958: ind_clave=0
959: goto ChangePassword
960: end if
961: end if
962: if (kp=enter) and (bandera_newPass =1) and (ind_clave=5) then
963: Lcd_Out(2, 1,"REP PASS:")
964: ind_clave=0 bandera_oldPass =0 bandera_newPass =0 bandera_repPass =1
965: SetStr(txt_numero," ",16)
966: end if
967: if (kp=enter) and (bandera_repPass =1) and (ind_clave=5) then
968: if validar_clave(bte_new_pass,bte_rep_pass ,ind_clave)=1 then
969: SavePassword(bte_new_pass)
970: ShowMessage(2,3,900,"PASS CHANGED")
971: ind_clave=0
972: goto INICIO
973: else
974: ShowMessage(2,3,900,"PASS NO MATCH")
975: ind_clave=0
976: goto MENU
977: end if
978: end if
979: wend
980: END.

18/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Puerta Autores: Ricardo Cajo - Jorge Galarza

1: program Codigo_Alarma_Puerta
2: dim n_envios,received_byte,viajero,cod_alarma as byte
3: dim Estado_Alarma,checksun_enviar, acknoledge as byte
4: dim checksun_recibido, checksun_calculado ,cont as byte
5: dim dato as byte[5]
6: const INICIO = $24
7: const ID = $49
8: const FIN = $46
9: const CODIGO=$07
10:
11: sub procedure interrupt()
12:
13: ' Usart_Data_Ready es lo mismo que haber puesto PIR1.RCIF
14: if Usart_Data_Ready = 1 then
15: received_byte = Usart_Read
16: select case viajero
17:
18: case 0
19: if (received_byte=INICIO) then '$'
20: viajero=1
21: else
22: viajero=0
23: end if
24:
25: case 1
26: if (received_byte=ID) then 'I' ID
27: viajero=2
28: else
29: viajero=0
30: end if
31:
32: case 2
33: dato[0]=(received_byte) 'Codigo Alarma
34: viajero=3
35: case 3
36: dato[1]= received_byte 'Estado Alarma
37: viajero=4
38: case 4
39: dato[2]= received_byte 'Acknoledge
40: viajero=5
41:
42: case 5
43: dato[3]= received_byte 'checksun_recibido
44: checksun_recibido =dato[3]
45: viajero=6
46: case 6
47: dato[4]=received_byte
48: if(dato[4]= FIN)then 'F' STOP
49: checksun_calculado = dato[0]+dato[1]+dato[2]
50: if(checksun_calculado = checksun_recibido )then
51: cod_alarma =dato[0]
52: Estado_Alarma=dato[1]
53: acknoledge =dato[2]
54: viajero=0
55: else
56: viajero=0
57: end if
58: else
59: viajero=0
60: end if

19/25 mikroBasic compiler for PIC by mikroElektronka


Codigo Alarma Puerta Autores: Ricardo Cajo - Jorge Galarza

61: end select


62:
63: end if
64: PIR1.RCIF=0 ' Si el dato a llegado limpio la bandera de recepcion
65: PIE1.RCIE=1 ' Habilitar nuevamente la interrupcion por USART
66: end sub
67:
68: sub procedure Led()
69: SetBit(PORTB,3)
70: Delay_ms(200)
71: ClearBit(PORTB,3)
72: Delay_ms(200)
73: SetBit(PORTB,3)
74: Delay_ms(200)
75: ClearBit(PORTB,3)
76: Delay_ms(200)
77: SetBit(PORTB,3)
78: Delay_ms(200)
79: ClearBit(PORTB,3)
80: end sub
81:
82: sub procedure Enable_HMTR()
83: SetBit(PORTB,4) 'Enable HM-TR
84: end sub
85:
86: sub procedure Disable_HMTR()
87: ClearBit(PORTB,4) 'Enable HM-TR
88: end sub
89: sub procedure Enviar_Alerta_Respuesta(dim Estado,Alerta,respuesta as byte)
90:
91: checksun_enviar =Estado +Alerta +CODIGO+ respuesta
92: USART_Write (INICIO )
93: USART_Write (ID)
94: USART_Write (CODIGO)
95: USART_Write (Estado)
96: USART_Write (Alerta)
97: USART_Write (respuesta) 'Acknoledge
98: USART_Write (checksun_enviar )
99: Usart_Write (FIN )
100:
101: end sub
102: main:
103:
104: OPTION_REG = %10000000
105: INTCON = %11000000 ' Enable external interrupts bit(7) and bit(6) de
permiso q no se controlan con INTCON
106:
107: PIE1=%00100000
108: PIR1=0
109:
110: CMCON=$07 'Para Configurar el PORTA COMO I/O Digitales y apagar el
comparador Analogico
111:
112: TRISA = %10000000 'RA0,RA1,RA2,RA3,RA4,RA7 Input RA6 OUTPUT
113: TRISB = %00000011
114:
115: PORTA=0
116: PORTB=0
117: n_envios =0
118: received_byte=0

20/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Puerta Autores: Ricardo Cajo - Jorge Galarza

119: viajero=0
120: cod_alarma=0
121: Estado_Alarma=0
122: acknoledge=0
123: cont=0
124: checksun_enviar =0
125: checksun_recibido =0
126: checksun_calculado =0
127: Usart_Init(9600)
128: Led()
129: 'sleep
130: Enable_HMTR ()
131: while(1) ' While there is no interrupt, program runs in
endless loop:
132:
133: if(cod_alarma =CODIGO )then
134: if( Estado_Alarma =1)then
135: SetBit(PORTB,3)
136: delay_ms(50)
137: Enviar_Alerta_Respuesta (1,0,1)
138:
139:
140: else
141: ClearBit(PORTB,3)
142: delay_ms(50)
143: Enviar_Alerta_Respuesta (0,0,1)
144: end if
145: cod_alarma=0
146: end if
147: if(Estado_Alarma=1)then
148: if(PortB.0=1)then
149: if(n_envios =0) then
150: Enviar_Alerta_Respuesta (1,1,1)
151: delay_ms(1000)
152: if(acknoledge =1)then
153: n_envios=1
154: acknoledge =0
155: cont=0
156: else
157: inc(cont)
158: if(cont<5)then
159: n_envios=0
160: else
161: cont=0
162: n_envios=1
163: end if
164: end if
165: end if
166: else
167: n_envios =0
168: end if
169: end if
170:
171: wend
172:
173: end.

21/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Movimiento Autores: Ricardo Cajo - Jorge Galarza

1: program Codigo_Alarma_Movimiento
2: dim n_envios,received_byte,viajero,cod_alarma,n_presencia as byte
3: dim Alert_Alarma,Estado_Alarma,checksun_enviar, acknoledge as byte
4: dim checksun_recibido, checksun_calculado ,cont as byte
5: dim dato as byte[5]
6: const INICIO = $24
7: const ID = $49
8: const FIN = $46
9: const CODIGO=$0A
10:
11: sub procedure interrupt()
12:
13: ' Usart_Data_Ready es lo mismo que haber puesto PIR1.RCIF
14: if Usart_Data_Ready = 1 then
15: received_byte = Usart_Read
16: select case viajero
17:
18: case 0
19: if (received_byte=INICIO) then '$'
20: viajero=1
21: else
22: viajero=0
23: end if
24:
25: case 1
26: if (received_byte=ID) then 'I' ID
27: viajero=2
28: else
29: viajero=0
30: end if
31:
32: case 2
33: dato[0]=(received_byte) 'Codigo Alarma
34: viajero=3
35: case 3
36: dato[1]= received_byte 'Estado Alarma
37: viajero=4
38: case 4
39: dato[2]= received_byte 'Acknoledge
40: viajero=5
41:
42: case 5
43: dato[3]= received_byte 'checksun_recibido
44: checksun_recibido =dato[3]
45: viajero=6
46: case 6
47: dato[4]=received_byte
48: if(dato[4]= FIN)then 'F' STOP
49: checksun_calculado = dato[0]+dato[1]+dato[2]
50: if(checksun_calculado = checksun_recibido )then
51: cod_alarma =dato[0]
52: Estado_Alarma=dato[1]
53: acknoledge =dato[2]
54: viajero=0
55: else
56: viajero=0
57: end if
58: else
59: viajero=0
60: end if

22/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Movimiento Autores: Ricardo Cajo - Jorge Galarza

61: end select


62:
63: end if
64:
65: if(INTCON.INTF =1)THEN
66: Inc(n_presencia )
67: if(n_presencia =4)then
68: Alert_Alarma =1
69: n_presencia =0
70: end if
71: end if
72:
73: INTCON.INTF=0
74: INTCON.INTE =1
75: PIR1.RCIF=0 ' Si el dato a llegado limpio la bandera de recepcion
76: PIE1.RCIE=1 ' Habilitar nuevamente la interrupcion por USART
77: end sub
78:
79: sub procedure Led()
80: SetBit(PORTB,3)
81: Delay_ms(200)
82: ClearBit(PORTB,3)
83: Delay_ms(200)
84: SetBit(PORTB,3)
85: Delay_ms(200)
86: ClearBit(PORTB,3)
87: Delay_ms(200)
88: SetBit(PORTB,3)
89: Delay_ms(200)
90: ClearBit(PORTB,3)
91: end sub
92:
93: sub procedure Enable_HMTR()
94: SetBit(PORTB,4) 'Enable HM-TR
95: end sub
96:
97: sub procedure Disable_HMTR()
98: ClearBit(PORTB,4) 'Enable HM-TR
99: end sub
100: sub procedure Enviar_Alerta_Respuesta(dim Estado,Alerta,respuesta as byte)
101:
102: checksun_enviar =Estado +Alerta +CODIGO+ respuesta
103: USART_Write (INICIO )
104: USART_Write (ID)
105: USART_Write (CODIGO)
106: USART_Write (Estado)
107: USART_Write (Alerta)
108: USART_Write (respuesta) 'Acknoledge
109: USART_Write (checksun_enviar )
110: Usart_Write (FIN )
111:
112: end sub
113: main:
114:
115: OPTION_REG = %10000000
116: INTCON = %11010000 ' Enable external interrupts bit(7) and bit(6) de
117: ' permiso q no se controlan con INTCON
118:
119: PIE1=%00100000
120: PIR1=0

23/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Movimiento Autores: Ricardo Cajo - Jorge Galarza

121:
122: CMCON=$07 'Para Configurar el PORTA COMO I/O Digitales y apagar el
123: 'comparador Analogico
124:
125: TRISA = %10000000 'RA0,RA1,RA2,RA3,RA4,RA7 Input RA6 OUTPUT
126: TRISB = %00000011
127:
128: PORTA=0
129: PORTB=0
130: n_envios =0
131: received_byte=0
132: viajero=0
133: cod_alarma=0
134: Estado_Alarma=0
135: Alert_Alarma=0
136: acknoledge=0
137: n_presencia =0
138: cont=0
139: checksun_enviar =0
140: checksun_recibido =0
141: checksun_calculado =0
142: Usart_Init(9600)
143: Led()
144: 'sleep
145: Enable_HMTR ()
146: while(1) ' While there is no interrupt, program runs in endless loop:
147:
148: if(cod_alarma =CODIGO )then
149: if( Estado_Alarma =1)then
150: SetBit(PORTB,3)
151: delay_ms(50)
152: Enviar_Alerta_Respuesta (1,0,1)
153:
154:
155: else
156: ClearBit(PORTB,3)
157: delay_ms(50)
158: Enviar_Alerta_Respuesta (0,0,1)
159: end if
160: cod_alarma=0
161: end if
162: if(Estado_Alarma=1)then
163: if(Alert_Alarma =1)then
164: if(n_envios =0) then
165: Enviar_Alerta_Respuesta (1,1,1)
166: delay_ms(1000)
167: if(acknoledge =1)then
168: n_envios=1
169: Alert_Alarma =0
170: acknoledge =0
171: cont=0
172: else
173: inc(cont)
174: if(cont<5)then
175: n_envios=0
176: else
177: cont=0
178: n_envios=1
179: end if
180: end if

24/25 mikroBasic compiler for PIC by mikroElektronika


Codigo Alarma Movimiento Autores: Ricardo Cajo - Jorge Galarza

181: end if
182: else
183: n_envios =0
184: end if
185: end if
186:
187: wend
188:
189: end.

25/25 mikroBasic compiler for PIC by mikroElektronika

Vous aimerez peut-être aussi