;***************************************************************************
;*                              mowayWorld                                 *
;***************************************************************************
;*Description:                                                             *
;*Automatically generated code                                             *
;***************************************************************************
;***************************************************************************
	list p=18F86j50
   ;*	Include mOways microcontroller
   #include "inc\P18F86j50.INC"

;*	Reset Vector
  org		0x1000
  goto	INIT
;*	Program memory	*
  org		0x102A
;************************
;***************************[MOWAY LIBRARIES]*********************************************
  #include "inc\lib_sen_moway_GUI.inc"
  #include "inc\lib_rf2gh4_GUI.inc"
  #include "inc\lib_mot_moway_GUI.inc"
  #include "inc\lib_cam_moway_GUI.inc"
;*************************************

INIT:

;#####################################
  ;*************************[MOWAY CONFIGURATION]***********************
  ;Sensor configuration
  call    SEN_CONFIG
  ;Motor configuration
  call    MOT_CONFIG

;************Module Pause***********************************************

;***********************************************************************

  banksel	    AUX_00	 
  movlw   .60
  movwf   AUX_00
  call    Delay_50ms_mOwayGUI

;***********************************************************************


label0:
;*****************Module Compare Noise*********************************

;**********************************************************************

  call    SEN_MIC_ANALOG
  movf    SEN_MIC,W
  movwf   AUX_01
  clrf    AUX_00
  addlw   .205
  btfss   STATUS,C
  incf    AUX_00,F
  movf    AUX_01,W
  sublw   .50
  btfss   STATUS,Z
  incf    AUX_00,F
  btfsc   AUX_00,1
  goto    label0

;***********************************************************************
;************Module Move*************************************************

;***********************************************************************

  movlw   .50
  movwf   MOT_VEL
  bcf     MOT_CON,COMTYPE
  movlw   .150
  movwf   MOT_T_DIST_ANG
  bsf     MOT_CON,FWDBACK
  call    MOT_STR
  call    MOT_CHECK_END

;***********************************************************************

loopEnd:
  goto    loopEnd

END
