Professional Documents
Culture Documents
Moway World
Moway World
;* mowayWorld *
;***************************************************************************
;*Description: *
;***************************************************************************
;***************************************************************************
list p=18F86j50
#include "inc\P18F86j50.INC"
;****************************************
;* Variables *
;****************************************
;* Reset Vector
org 0x1000
goto INIT
;* Program memory *
org 0x102A
;************************
;***************************[MOWAY LIBRARIES]*********************************************
;*************************************
INIT:
;#####################################
;*************************[MOWAY CONFIGURATION]***********************
;Sensor configuration
;Motor configuration
;****************************************
;************Module Move*************************************************
;***********************************************************************
call MOT_STR
;***********************************************************************
;************Module Speaker*********************************************
;***********************************************************************
movlw SPEAKER_ON
movwf SEN_SPEAKER_ON_OFF
call SEN_SPEAKER
;***********************************************************************
;************Module Leds************************************************
;***********************************************************************
call LED_FRONT_ON_OFF
call LED_BRAKE_ON_OFF
call LED_TOP_GREEN_ON_OFF
;***********************************************************************
;**************Module Turn**********************************************
;***********************************************************************
movlw .30
movwf MOT_VEL
bcf MOT_CON,COMTYPE
movlw .25
movwf MOT_T_DIST_ANG
movlw 0x01
movwf MOT_CENWHEEL
bcf MOT_CON,RL
bsf MOT_CON,FWDBACK
call MOT_ROT
call MOT_CHECK_END
;***********************************************************************
;************Module Move*************************************************
;***********************************************************************
movlw .50
movwf MOT_VEL
bcf MOT_CON,COMTYPE
movlw .100
movwf MOT_T_DIST_ANG
bsf MOT_CON,FWDBACK
call MOT_STR
call MOT_CHECK_END
;***********************************************************************
;**************Module Turn**********************************************
;***********************************************************************
movlw .50
movwf MOT_VEL
bcf MOT_CON,COMTYPE
movlw .50
movwf MOT_T_DIST_ANG
movlw 0x01
movwf MOT_CENWHEEL
bsf MOT_CON,RL
bsf MOT_CON,FWDBACK
call MOT_ROT
call MOT_CHECK_END
;***********************************************************************
;************Module Move*************************************************
;***********************************************************************
movlw .50
movwf MOT_VEL
bsf MOT_CON,COMTYPE
movlw .60
movwf MOT_T_DIST_ANG
bsf MOT_CON,FWDBACK
call MOT_STR
call MOT_CHECK_END
;***********************************************************************
;***********************************************************************
movlw SPEAKER_OFF
movwf SEN_SPEAKER_ON_OFF
call SEN_SPEAKER
;***********************************************************************
;************Module Leds************************************************
;***********************************************************************
call LED_FRONT_OFF
call LED_BRAKE_OFF
call LED_TOP_GREEN_OFF
call LED_TOP_RED_OFF
;***********************************************************************
;************Module Pause***********************************************
;***********************************************************************
banksel AUX_00
movlw .20
movwf AUX_00
call Delay_50ms_mOwayGUI
;***********************************************************************
loopEnd:
goto loopEnd
END