Hi there.
i am trying to make a RGB light using LED's. i have two main 08m chips that have the programs that controls three other 'slave' 08m's. the main chips have a serial out commands and the three 'slaves' have the serial in command, which takes the data in and does a pwm out. however, to make it work i need to put a LED between the input signal pin of the slave and ground. no other component will work. here is the code i am using:
fade: let b1=85
let b2=170
let b3=255
loop1:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b1=0 then goto loop2
goto loop1
loop2:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b2=0 then goto loop3
goto loop2
loop3:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b3=0 then goto loop4
goto loop3
loop4:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b1=255 then goto loop5
goto loop4
loop5:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b2=255 then goto loop6
goto loop5
loop6:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b3=255 then goto fade
goto fade
this is the program that i have in my main chip and it is supposed to fade the three led's that are connected to my slave chips.
this is the program for my slave:
main:
input 4
serin 4,N2400,b1
pwmout pin2,b1,100
goto main
pin 2 is connected to an led.
my main problem is that the two chips are not talking to eachother properly. is there something wrong with my programme or the hardware?
cheers
pete
i am trying to make a RGB light using LED's. i have two main 08m chips that have the programs that controls three other 'slave' 08m's. the main chips have a serial out commands and the three 'slaves' have the serial in command, which takes the data in and does a pwm out. however, to make it work i need to put a LED between the input signal pin of the slave and ground. no other component will work. here is the code i am using:
fade: let b1=85
let b2=170
let b3=255
loop1:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b1=0 then goto loop2
goto loop1
loop2:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b2=0 then goto loop3
goto loop2
loop3:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3-1
serout 4,N2400,(b3)
pause 20
if b3=0 then goto loop4
goto loop3
loop4:let b1=b1+1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b1=255 then goto loop5
goto loop4
loop5:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2+1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b2=255 then goto loop6
goto loop5
loop6:let b1=b1-1
serout 0,N2400,(b1)
let b2=b2-1
serout 2,N2400,(b2)
let b3=b3+1
serout 4,N2400,(b3)
pause 20
if b3=255 then goto fade
goto fade
this is the program that i have in my main chip and it is supposed to fade the three led's that are connected to my slave chips.
this is the program for my slave:
main:
input 4
serin 4,N2400,b1
pwmout pin2,b1,100
goto main
pin 2 is connected to an led.
my main problem is that the two chips are not talking to eachother properly. is there something wrong with my programme or the hardware?
cheers
pete