Portifolio 2 - Cuscopic

283 palavras 2 páginas
Progamação da CUSCOPIC

'****************************************************************
'* Name : PROJETO INTEGRADOR.BAS
'* Author : WEB
'* Notice : MECALOUCOS
'* Date : 10/5/2012
'* Version : 1.0
'* Notes : ' Define oscilador do MCU
DEFINE OSC 20

' Define configuração do LCD
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 0
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

' Define os pinos como entrada e saida em cada port.
TRISA=%00000011
TRISB=%00000000
TRISC=%00000000
TRISD=%11110000
TRISE=%00000000

' Define as variaveis contador var byte cont_inc var byte cont_dec var byte tecla var byte cont_motorx var byte cont_motory var byte cont_motorz var byte 'Inicio do programa
LOOP:

Pause 1

INCLUDE "Controle LCD.bas" include "simulacao.bas" include "motor x.bas" include "motor y.bas" include "motor z.bas" include "Controle teclado.bas"

GOTO LOOP

END

'****************************************************************
'* Name : CONTROLE LCD.BAS
'* Author : WEB
'* Notice : Copyright (c) 2012 MECALOUCOS
'* Date : 14/5/2012
'* Version : 1.0
'* Notes :
'****************************************************************

LCDOUT $FE, 1 ' limpa lcd
LCDOUT $FE, 2 ' Inicia na primeira linha
LCDOUT "Contador = ",#contador lcdout $FE,$14

Relacionados