You are on page 1of 6

;***************************************************************************

;* mowayWorld *

;***************************************************************************

;*Description: *

;*Automatically generated code *

;***************************************************************************

;***************************************************************************

list p=18F86j50

;* Include mOways microcontroller

#include "inc\P18F86j50.INC"

;****************************************

;* Variables *

;****************************************

astmfg EQU 0x7E

qwfhjjj EQU 0x7D

;* Reset Vector

org 0x1000

goto INIT

;* Program memory *

org 0x102A

;************************

;***************************[MOWAY LIBRARIES]*********************************************

#include "inc\lib_sen_moway_GUI.inc" ;incluye librerías de los sensores

#include "inc\lib_rf2gh4_GUI.inc" ;incluye librerías del modulo rf

#include "inc\lib_mot_moway_GUI.inc" ;incluye librerías de los motores

#include "inc\lib_cam_moway_GUI.inc" ;incluye librerías de la camara

;*************************************

INIT:

;#####################################

;*************************[MOWAY CONFIGURATION]***********************
;Sensor configuration

call SEN_CONFIG ; se llama la function de configuracion de sensores

;Motor configuration

call MOT_CONFIG ;se llama la function de configuracion de sensores

;****************************************

;************Module Move*************************************************

;***********************************************************************

movlw .50 ;carga insturciones al registro w

movwf MOT_VEL ; mueve los datos del registro w al registro f

bsf MOT_CON,COMTYPE ; PONE EN CERO EL REGISTRO COM

movlw .50 ;carga insturciones al registro w

movwf MOT_T_DIST_ANG ; MUEVE LOS DATOS DEL REGISTRO W AL F

bsf MOT_CON,FWDBACK ; PONE EN CERO EL REGISTRO FWDBACK

call MOT_STR

call MOT_CHECK_END ;llama la function

;***********************************************************************

;************Module Speaker*********************************************

;***********************************************************************

movlw .88 ;carga insturciones al registro w

movwf SEN_SPEAKER_FREQ ; mueve los datos del registro w al registro f del


controlador del 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

;***********************************************************************

;************Module Stop Speaker****************************************

;***********************************************************************

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

You might also like