Leostick Tunes

We keep or move all the cool LeoStick demos, fun stuff, example code and sketches here...
Post Reply
smarthall
Posts: 6
Joined: Mon Jan 16, 2012 3:24 am

Leostick Tunes

Post by smarthall » Mon Jan 16, 2012 3:27 am

I've put up a hacked version of one of the Tone library examples that works on the LeoStick using software PWM.

You can find it on gist here: https://gist.github.com/1618800

marc
Freetronics Staff
Freetronics Staff
Posts: 16
Joined: Sat Oct 15, 2011 12:54 pm

Re: Leostick Tunes

Post by marc » Mon Jan 16, 2012 11:27 am

That was so cool today in the miniconf hearing all the LeoStick Tunes fire up and play!
Have had a few people ask about this already and pointed them to the code, looks like a bunch of others are having a great time playing with theirs too :)
Cheers,
Marc

smarthall
Posts: 6
Joined: Mon Jan 16, 2012 3:24 am

Re: Leostick Tunes

Post by smarthall » Mon Jan 16, 2012 12:33 pm

I made a video for anyone watching who isn't at the conference and unable to experience the joy of programming a little USB key to play a tune. You can find it at: http://yfrog.com/n2p80z

jnewbigin
Posts: 1
Joined: Mon Jan 23, 2012 1:00 am

Re: Leostick Tunes

Post by jnewbigin » Mon Jan 23, 2012 1:06 am

The code in git (revision 98c987) has a bug. It does not convert the frequency into a delay duration.
Needs
danDur = 1000000 / danFreq;
...
delayMicroseconds(danDur);
...
delayMicroseconds(danDur);

Then it works.

marc
Freetronics Staff
Freetronics Staff
Posts: 16
Joined: Sat Oct 15, 2011 12:54 pm

Re: Leostick Tunes

Post by marc » Sat Feb 11, 2012 3:47 pm

Thanks! I've had a great time playing with this :)

The latest version is here, with the fix too: https://gist.github.com/1800871

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest