The best way to learn, is to place the program on a PIC and see what's happen with. Try to modify it and see how it affect different parts. You can't blow anything. The worst situation will be 'syntax error' or something like that.
The best way to learn, is to place the program on a PIC and see what's happen with. Try to modify it and see how it affect different parts. You can't blow anything. The worst situation will be 'syntax error' or something like that.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yea, I know! My stuff is in the mail though.. doh! And I really am trying to understand how this program works. It does independantly vary the duty cycle of the different colors right? HOW!?!Originally Posted by mister_e
I really appreciate your time - I can't wait to get my PICs.
Eureka!
I got it!
------------------------------------------
ledPWM:
For y = 0 to 2
Select Case y
Case 0
pwm red, rbgarray[y], 1
case 1
pwm green, rbgarray[y], 1
case 2
pwm blue, rbgarray[y], 1
end select
------------------------------------------
I was having trouble realizing that the nested Case statement in the For statement was hitting "red" with rbgarray[1], "green" with rbgarray[2] and "blue" with rbgarray[3] - which are each different values between 1-256!
It's like the sun rising, in my mind..
Although this sequence works reasonably well. Why do the LEDs when they have faded to OFF remain slightly lit when realy they should be OFF?
Also, during the sequence, one LED jumps quickly to another, I have it when BLUE goes OFF, it jumps to RED quickly, then goes OFF again. Are others getting the same, it is quite quick.
Is there any other RGB sequences out there that perform a similar task??
Cheers,
Steve
i think it's more a math calculation overflow... try to do some simple calculation when 'rainbowval' is reaching something like 200,230,240... or lower. if you have ICD capability it's easy to see whats happen. MicroCode free version have ICD for 16F628.
See Bruce's website Here for the ICD explanation
Here to buy full version or to download free version Of MicroCode Studio
it's worth every $ you'll place on this program.
Last edited by mister_e; - 8th March 2005 at 03:50.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks