June 11, 2014

Pong on a 'scope: Dicking around with XY mode

I'll start this entry like this:
The 'problem' with me is, that when I figure out how to do something, I keep expanding that, until it goes completely mad. What I'm talking about now is dicking around with the XY mode of a scope with a DAC.

Pong-o-scope.
After some more dicking around with drawing stuff with the XY mode, I rumbled upon my parts bin again, and found a pot. That made me think the junk I make appear on the screen is just a little bit too uninteractive, and after an hour or so, I wrote this Pong game. I know it sucks, it's buggy and glitchy at times, it looks awful, but that's just something I made once again, so I thought about slapping it onto my blog. Why not, right?

How not to breadboard 101
On the right you can see a couple of photos of my current setup. If you are any sane, you're probably looking for something to puke into now, because that's pretty much how NOT to breadboard 101, but it works, right?

So, in case you're as crazy as I am and you'd like to slap one together as well, here's a quick howto:

What you need:


  • an Arduino or something like that
  • an MCP4822 DAC
  • a couple of pots of a reasonable value (anything between 2k2-100k should be right)
  • a breadboard
  • and obviously a dual channel analog oscilloscope - it has to be analog, because the XY mode on digital ones doesn't really work for this stuff well.

How to slap it together:

Here's a fritzing sketch for ya:
And HERE's the arduino source code.

Here's a video of it in action:


Conclusion:

I've slapped this thing together in just about an hour or so, so don't expect anything very much polished as always, but that means there's a ton of space for improvement - I'll probably add at least one thing into this project later - sound. It's completely silent now, which kinda sucks.
Also, I'm using a pixel approach - which kinda sucks as well! I'll probably switch to vectors once I figure out how to draw these properly (facepalm)...

I hope you like this project.
Also, don't forget to leave a comment!

No comments:

Post a Comment