با سلام خدمت دوستان و اساتید
این پست جهت راهاندازی آی سی 2811 با کمک بسکام و بدون استفاده از لایبرری میباشد
- - - Updated - - -
$regfile = "m16def.dat"
$crystal = 16000000
config portb.0=output
led alias portb.0 پایه اصلی خروجی
config portb.1=output
led2 alias portb.1 پایه کمکی فقط جهت ایجاد وقفه هایه چند نانو ثانیه ای
dim r as Byte,g as Byte,b as Byte,i as Byte,j as Byte
j=18 تعداد بلوک rgb
do
for i=1 to j
gosub lbl0
next
waitms 500
r=rnd(256)
g=rnd(256)
b=rnd(256)
loop
end
lbl0:
if r.7=0 then gosub lbl1 else gosub lbl2
if r.6=0 then gosub lbl1 else gosub lbl2
if r.5=0 then gosub lbl1 else gosub lbl2
if r.4=0 then gosub lbl1 else gosub lbl2
if r.3=0 then gosub lbl1 else gosub lbl2
if r.2=0 then gosub lbl1 else gosub lbl2
if r.1=0 then gosub lbl1 else gosub lbl2
if r.0=0 then gosub lbl1 else gosub lbl2
if g.7=0 then gosub lbl1 else gosub lbl2
if g.6=0 then gosub lbl1 else gosub lbl2
if g.5=0 then gosub lbl1 else gosub lbl2
if g.4=0 then gosub lbl1 else gosub lbl2
if g.3=0 then gosub lbl1 else gosub lbl2
if g.2=0 then gosub lbl1 else gosub lbl2
if g.1=0 then gosub lbl1 else gosub lbl2
if g.0=0 then gosub lbl1 else gosub lbl2
if b.7=0 then gosub lbl1 else gosub lbl2
if b.6=0 then gosub lbl1 else gosub lbl2
if b.5=0 then gosub lbl1 else gosub lbl2
if b.4=0 then gosub lbl1 else gosub lbl2
if b.3=0 then gosub lbl1 else gosub lbl2
if b.2=0 then gosub lbl1 else gosub lbl2
if b.1=0 then gosub lbl1 else gosub lbl2
if b.0=0 then gosub lbl1 else gosub lbl2
return
lbl1:
'*******
'******* 0 start low speed 500ns - 2us
set led
set led2
set led2
set led2
reset led
set led2
set led2
set led2
set led2
set led2
set led2
'******* 0 stop
return
lbl2:
'******* 1 start low speed 1200ns -- 1300ns
set led
set led2
set led2
set led2
set led2
set led2
set led2
set led2
set led2
set led2
reset led
set led2
'******* 1 stop
return