PWM API module- beta version

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Post Reply
spamiam
Posts: 739
Joined: 13 November 2005, 6:39 AM

PWM API module- beta version

Post by spamiam »

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
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
lightsaber
Posts: 1
Joined: 30 May 2008, 10:26 AM

Post by lightsaber »

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!!
Post Reply