micro adventures

January 10, 2010

Audio Spectrum Analyser for Ping-Pong Board from Conrad.de

Filed under: PONG Board — Tags: , , , — Piotr @ 8:42 pm

Audio spectrum analyser driven by Atmega AVR seems to be a one of the favourite topics. Pong board gives us a nice display with 12 column ten LEDs each. This makes this display a perfect one for a spectrum analyser.  I will not elaborate here any mathematics part of a spectrum analysis. What you need is a discrete Fourier transformation (DFT) or better to say a respective fast algorithm so called FFT. Luckily FFT (its fixed point version) was implemented for Atmega AVR by ChaN in 2005. See for details http://elm-chan.org/works/akilcd/report_e.html. I reused his code and by adding some neccessary lines I made out of the Pong board an audio spectrum analyser.

The audio signal  is connected to the Right Potentiometer via  100µF capacitor. A really bad solution :(

The results are not bad – see two examples.

Remark: in the second video I used some commercial music. It has been flatten by my monitor speakers and microphone from digi cam but we know youtube . I hope they will not remove this clip or get rid of the soundtrack.

I’m quite satisfy with so simple implementation and a pretty good result. I would add here kind of op-amp as a input filter. Max239 from ChaN’s projekt seems to be a good idea. From the application point of view I would look closer to the size of the buffer used for data samples. A decrease to 32 and getting 16 results fits much better to our small display.  And more display effects would make this more interesting.

The sounds at the begining part is not the best, I will make the video once again if someone will ask for :)

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=-YsMRiT4e94

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=Dwob_27O8SM

Here another video, from local host (commercial audio and youtube policy make me crazy)

By the way:

In the first video I used two free programs from http://www.marchandelec.com: very simple function generator and third octave real time spectrum analyser. It is a pity there is nothing similar under linux. The only one I found it was python based tone.py: http://aa6e.net/software/tone/index.html. It does not work for me in my new Pulse Audio environment (padsp does not solve anything). Another peace of software, a command line tonegenerator: http://www.lns.com/papers/tonegen/ works fine with padsp.

Any your feedback regarding Pong Audio Spectrum Analyser or a function generator under linux is highly appreciated.

download

Download AVR 4 Studio / WinAVR files from here

A Car Race on Pong board

Filed under: PONG Board — Tags: , , — Piotr @ 12:41 am

Actually the first application I wrote for Pong Board from Conrad was a “car race”. This was mostly a quick & dirty prove of concept. I wanted to test the board and learn some basic features of atmega8. By the way I’ve never wrote a single code for atmega µControler before :) .

Any way here you have a next version of Need for Speed with a huge screen resolution of 12×10 pixels.

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=9cIecm-IPiI

Download the bascom source and hex files from here.

Although it was only a quick attempt to make something different from ping-pong and a learning by doing approach You can find in the source code some interesting parts.

1) I’m initializing the random generator based on the value from ADC in order to make the road different each time.

2) The road is calculated in that way that there is always enough pleace for the car. The road outline/direction changes at least after two steps forward, in order to avoid a rapid changes left-right-left-right.

Probably I will rewrite this in c and add some more features :)

January 9, 2010

GPL Free PONG on conrad.de board

Filed under: PONG Board — Tags: , , — Piotr @ 9:48 pm

Hello

During the last Xmas I finished some code for Pong Board availble at Conrad.de

Since the board is available only with a closed pong *.hex file I decided to write my onw version.

Get the Flash Player to see this player.

http://www.youtube.com/watch?v=TvPQ2mHwC4E

Download the AVR 4 Studio / WinAVR files from here

My code provides you some additional features in compare to the “original” firmaware of the Pong Board.

You can setup speed of the game in a more convenient way. Game’s result is displayed with digits. I created a bit more complex pong physics, by calculating dynamic of the pad movement. The quicker you move your pad the bigger is an  angle the ball mirror.  If there will be any demand to elaborate this or any other part of the code let me know.

Your feedback and remarks are appreciated!

Powered by WordPress