;***********************************************************
;对于pic10F200芯片,内部晶振校准值参数在0xFF地址存储的
ORG 0x0000
movwf OSCCAL
goto start
;**********************************************************
;LED闪烁模式查找表
;对于每一种闪烁模式,必须在有一个相应的分支入口
;返回值max.mode同样必须设置
radix dec
select.mode movfw mode
addwf PCL,f
retlw mode.1
retlw mode.2
retlw mode.3
retlw mode.4
retlw mode.5
retlw mode.6
retlw mode.7
max.mode retlw 7 ;模式最大种类数
;定义闪烁序列
;ledstep hold_time,power_save,LED1_state,LED2_state,LED3_state
;hold_time是1-255的数值,没计一个数单位20ms,所以当hold_time=50时,就是1000ms
;power_save定义了省电模式,开启后LED亮度略暗,更省电
;psoff---省电模式关闭,全功率运行
;pson---省电模式开启,节电运行
;LEDx_state 定义灯的亮或灭
;模式1,常量,节电模式
mode.1 ledstep 50,pson,led1on,led2on,led3on
restart
;模式2,常量,正常模式
mode.2 ledstep 50,psoff,led1on,led2on,led3on
restart
;模式3,所有闪烁,节电模式
mode.3 ledstep 18,pson,led1on,led2on,led3on
ledstep 18,pson,led1off,led2off,led3off
restart
;模式4,单个LED亮,正常模式
mode.4 ledstep 12,psoff,led1on,led2off,led3off
ledstep 12,psoff,led1off,led2on,led3off
ledstep 12,psoff,led1off,led2off,led3on
ledstep 12,psoff,led1off,led2on,led3off
restart
;模式5,所有LED频闪,正常模式
mode.5 ledstep 2,psoff,led1on,led2on,led3on
ledstep 30,psoff,led1off,led2off,led3off
restart
;模式6,所有LED短灭长亮,正常模式
mode.6 ledstep 2,psoff,led1on,led2off,led3off
ledstep 10,psoff,led1off,led2on,led3off
ledstep 60,pson,led1on,led2on,led3on
ledstep 10,psoff,led1off,led2on,led3off
restart
;模式7,所有LED短灭长亮,正常模式
mode.7 ledstep 1,psoff,led1on,led2off,led3off
ledstep 3,psoff,led1off,led2on,led3off
ledstep 1,psoff,led1on,led2off,led3off
ledstep 3,psoff,led1off,led2on,led3off
ledstep 1,psoff,led1on,led2off,led3off
ledstep 3,psoff,led1off,led2on,led3off
ledstep 1,psoff,led1on,led2off,led3off
ledstep 3,psoff,led1off,led2on,led3off
ledstep 1,psoff,led1on,led2off,led3off
ledstep 3,psoff,led1off,led2on,led3off
ledstep 1,psoff,led1on,led2off,led3off
ledstep 50,psoff,led1off,led2on,led3off
restart
;结束LED闪烁模式查找表
朋友 看你分析技术问题很赞!我们需要你这样的人才,撰写技术心得体会拿稿酬 请加我微信 kuaibao52 备注来自21ic