Here is my beta version of my ZBasic module to create PWM on pins 26 and 27. Channel 1 is the green LED, so you can see the output. THe thing to remember is that the LED is ON when the pin output is LOW!!! It has the opposite logic of the pin.
Try it out and let me know how you like it.
The demo program is designed to have a voltage divider pot on pin 14. You also need to comment-out the #DEFINE for the Sparkfun LCD if you do not have one. The LCD API uses identical commands to the ZBasic LED display, so you could substitute that one if you have it.
Comment-in the #DEFINE DEBUGGING line to get more info sent back to the PC.
-Tony
PWM API module- beta version
PWM API module- beta version
- Attachments
-
- PWM_API.zip
- This allows the generation of variable frequency, variable duty factor square wave output on pins 26, 27 of the ZX-24.
- (14.73 KiB) Downloaded 4406 times
-
- Posts: 1
- Joined: 30 May 2008, 10:26 AM
nice work!
if you want to just use a plug and play PWM USB device with API (and autogenerated code for many languages), check out http://www.arfx.nl
I have a couple of their PWM USB interfaces power some light and fans on my arcade cabinet.
cheers!!
if you want to just use a plug and play PWM USB device with API (and autogenerated code for many languages), check out http://www.arfx.nl
I have a couple of their PWM USB interfaces power some light and fans on my arcade cabinet.
cheers!!