Author Topic: PWM programming help?  (Read 2161 times)

Offline zbblanton

  • Acid Modder
  • *
  • Posts: 979
  • Post quality +5/-0
  • Gender: Male
    • My modding site
PWM programming help?
« on: March 17, 2009, 02:47:02 PM »
could someone give me a example of PWM code in  BasicPro.

i know this:
pwm GPIO.0,260,50

but im not sure how to like make a led fad slowly on and off with that.

Offline 802Chives

  • Sargeant at Arms
  • Acidmods Alumni
  • Millennium Poster
  • *
  • Posts: 1304
  • Post quality +10/-0
  • Gender: Male
Re: PWM programming help?
« Reply #1 on: April 22, 2009, 08:37:05 AM »
not sure how you would do it in basicpro... but esentially you will have to increment and decriment the 260 and 50 values respectively over the amount of time you wnat it to fade in and out.

so the values 310 and 0 would be on all the way, and 0 and 310 will be off all the way.  155 and 155 will be on %50.


Offline ryan0

  • I EAT STUFF
  • Millennium Poster
  • *
  • Posts: 1128
  • Post quality +0/-0
  • Gender: Male
  • I LIEK CHEEEEZE
Re: PWM programming help?
« Reply #2 on: April 26, 2009, 08:35:39 AM »
I would use C for the PWM programming,it is much more powerful,I know that one can make PWM with basic,but I can't remember how to make it.
Derp.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.5 © 2008-2012, SimplePortal