Author Topic: Game Idea for Digispark  (Read 6571 times)

greenglue

  • Newbie
  • *
  • Posts: 7
Game Idea for Digispark
« on: August 15, 2012, 06:55:06 pm »
Hi Everyone!
Glad we got the forums up and running!

I had an idea that coule become practical for the Digispark (and maybe even start a new Kickstarter with this idea).

Since the Digispark is so small, it's size is great for a game, something like a PONG or Snake styled game with a little LED screen and 4 buttons (up/down/left/right).
Now, I am not sure the Digispark would have enough pins to complete this task so I might have to wait out for the Digispark pro...

So, what do you guys thing? Maybe even keep the USB plug on it so the user can 'create' his own levels or games for it? So basically a very basic Digispark game console of sorts...

Thanks and hope for some feedback and/or interest!
Michael
« Last Edit: August 15, 2012, 06:55:06 pm by greenglue »

greenglue

  • Newbie
  • *
  • Posts: 7
Game Idea for Digispark
« Reply #1 on: August 16, 2012, 05:41:59 am »
I had the idea last night of also making this into a shield which would be much easier for the consumer to use.

sparr

  • Jr. Member
  • **
  • Posts: 70
Game Idea for Digispark
« Reply #2 on: August 16, 2012, 02:12:46 pm »
6 pins isn\'t enough to do this easily and naively, but you could definitely do it with a little extra hardware.

2 pins for this display: http://adafruit.com/products/872 (or its RGB counterpart for $40 elsewhere)

2-4 pins for this to read 4-16 input buttons: https://www.sparkfun.com/products/299

A serial multiplexer would be even more effective, but cost a little more.

So, total parts list for the shield might be those two products, 10 buttons (2 players, arrows plus fire!), the PCB... call it $20 as a kit without the digispark itself?

greenglue

  • Newbie
  • *
  • Posts: 7
Game Idea for Digispark
« Reply #3 on: August 16, 2012, 02:59:02 pm »
Very nice thinking! I would need to figure out how to use that chip though. That would be a great deal. Espescially if they can reprogram it.

Dennis

  • Newbie
  • *
  • Posts: 15
Game Idea for Digispark
« Reply #4 on: August 16, 2012, 04:03:47 pm »
@sparr: It is possible to use more buttons on one pin. The last project I worked with had 6 buttons attached to one pin. I used some resistors and the adc to distinguish between the pressed buttons.

sparr

  • Jr. Member
  • **
  • Posts: 70
Game Idea for Digispark
« Reply #5 on: January 11, 2013, 02:24:05 pm »
@Dennis 6 buttons on one pin is nice, but serial input multiplexers can give you hundreds of buttons on two pins, and a lot more reliably and quickly (ADC sampling isn\'t slow, but for an input button I\'d be worried about the delay)

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Game Idea for Digispark
« Reply #6 on: January 11, 2013, 03:34:57 pm »
The Digispark ADC can sample at 15khz with full 10-bit resolution, or even faster if you don\'t mind resolution going down a little. Compared to the 100hz sampling of most computer mice and keyboards, I think you\'ll be fine.

Trakkasure

  • Newbie
  • *
  • Posts: 28
Re: Game Idea for Digispark
« Reply #7 on: January 23, 2013, 09:08:10 am »
I would go for the 1 pin ADC method. 8-bits of resolution is fine with increased accuracy. hell.. even 4 bits is enough.


Wouldn't it also be possible to have an interrupt trigger the read when the pin registers a voltage?
This would be faster than polling.


I also used an I2C OLED display, boosting the I2C speed to 1Mhz, this means very fast display updates.
With other I2C devices, who knows what can be done... add-on peripherals. The 6k code limit
has always been a limiting factor writing code. I have ran out of space several times while trying
to prototype some ideas. Especially those with LCDs. (usually need to buffer the display locally)
Using I2C for add-ons means
Examples of addons: (Using I2C, this lessens the overall code required for device communications)
   GPS for getting outside and interacting with the real world ( Hi-Tech Hide and seek for example)
   WiFi for data (MMO on DigiSpark!)
   More input controllers: buttons, joysticks, trackballs, etc if you really need them.
   BioFeedback.
   Additional displays.

barnacleBudd

  • Newbie
  • *
  • Posts: 21
Re: Game Idea for Digispark
« Reply #8 on: February 07, 2013, 10:34:47 pm »
The most refreshing thing about the digispark is its size and limitations. 40 years ago when I was first learning to program on a TRS-80 with only 4K of memory, a computer magazine offered a challenge to write a complete computer game in only one line of BASIC. That was 256 characters. They published about a dozen entries.  I learned a lot by studying those one line games.
Digistump renews that kind of spirit. I look forward to the challenges. Let's not underestimate what this community might do.  Already I have learned that I can control an LCD panel with only 2 I/O pins instead of the 6 I was using with Arduino.  If I2C lets a digispark talk to an LCD with two wires, how hard would it be to use the same two wires to get two (or more) digisparks talking to each other? Wouldn't it be fun to write a game that was controlled by multiple boards. Hey, they do that in our automobiles.
I've started by first game on the digispark. Follow the progress on my blog.
http://mypetdigispark.blogspot.com/