Hello Srig,
Srig>>Hi, I am trying to control the intensity of an LED through pbp. Here is what I wanted to achieve, to set the intensity of the light to be 50% constant for 10 sec and then 25% constant for another 10 sec. Here is what I was trying to do, but not sure if this is correct pbp style of programming.... any help will be greatly appreciated. thank you. Not sure if the below code will work for my description. <<
It depends on how you want to do it....
If you want to keep the intensity goin while the chip is doing different things, you must use the HPWM. the hardware PWM will put out a steady stream as the chip does different things. If you use more than one LED, you will need two pins that have PWM on them.
If you only care about one pin at a time, and you do not care about the LED being shut off as the other LED is working, you can use *any* Chip and use the software PWM command.
Or you can make your own PWM routine.. Which is quite easy.
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks