' * ' * Nombre del Ejemplo ' Ejemplpo 6 ' * Autor: ' Ing. Pablo Rodas -CTS' * Fecha: ' 20111128: ' ' * Descripcion ' Mensajen en el LCD ' ' * Configuracion ' MCU: P16F887 ' Archivo Simulacion PROTEUS: Entrenador ' Oscillador: HS, 4.0000 MHz ' ' * NOTAS ' * ' SECCION DE DECLARACIONES DE SIMBOLOS '***************************************************************************** ' SECCION DE DECLARACIONES DE VARIABLES '***************************************************************************** dim LCD_RS as sbit sbit at RB2_bit LCD_EN as sbi sbit at RB3_bit LCD_D4 as sbi sbit at RB4_bit LCD_D5 as sbi sbit at RB5_bit LCD_D6 as sbi sbit at RB6_bit LCD_D7 as sbi sbit at RB7_bit LCD_RS_Direction as sbi sbit at TRISB2_bit LCD_EN_Direction as sbi sbit at TRISB3_bit LCD_D4_Direction as sbi sbit at TRISB4_bit LCD_D5_Direction as sbi sbit at TRISB5_bit LCD_D6_Direction as sbi sbit at TRISB6_bit LCD_D7_Direction as sbi sbit at TRISB7_bit i as byte byte ' SECCION DE DECLARACIONES DE CONSTANTES '*****************************************************************************
' SECCION DE SUBPROCEDIMIENTOS '***************************************************************************** sub procedu procedure re setup A N S EL = 0 ' Configuracion de los canales analogicos ANSE ANSELH LH = 0 ' (Puerto A,E y B)como digitales C1ON C1ON_b _bit it = 0 ' Apago los comparadores analogicos C2ON C2ON_b _bit it = 0 TRISD=0 TRISD=0 'PUERTO D como salidas TRISE=0 TRISE=0 'PUERTO E como salidas TRISB=0 TRISB=0 PORTD=0 PORTD=0 'apago los puertos PORTE=0 PORTE=0 PORTB=0 PORTB=0 end end sub sub
1/2
mikroBasic Pro for PIC by mikroElektronika
Ejemplo6.mbas
58: 59: 60: 61: 62: 63: 64: 65: 66: 67:
05/12/2011 8:56:57
'****************************************************************************** 'Programa Principal main: main: ' Main program setup Lcd_Init() Lcd_Cmd(_LCD_CLEAR) ' borra la pantalla Lcd_Cmd(_LCD_BLINK_CURSOR_ON) ' Cursor off Lcd_Out(1 Lcd_Out(1,1,"COLEGIO TECNICO SALESIANO") SALESIANO") ' escribe en la primera fil la primera columna Lcd_Out(2 Lcd_Out(2,5,"MECATRONICA" "MECATRONICA") ) ' segunda fila quinta columna Lcd_Cmd(_LCD_CURSOR_OFF) ' Lcd_Cmd(_LCD_UNDERLINE_ON) delay_ms(500 delay_ms(500) ) i=0 to 13 for i=0 LCD_CMD(_LCD_SHIFT_RIGHT) delay_ms(100 delay_ms(100) ) next i i=0 to 13 for i=0 LCD_CMD(_LCD_SHIFT_LEFT) delay_ms(100 delay_ms(100) ) next i Lcd_Cmd(_LCD_CLEAR) ' borra la pantalla Lcd_Out(1 Lcd_Out(1,5,"Sistemas" "Sistemas") ) ' escribe en la primera fila primera columna Lcd_Out(2 Lcd_Out(2,1,"Microcontrolados" "Microcontrolados") ) ' segunda fila quinta columna
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.