all | audio | badgelife | breakout | clocks | displays | experiments | feather | handhelds | home automation | howto | LED art | misc | props | robots | sewing | software | tools | no_category

Skeleton Attiny85 Handheld

I2C OLED connected to an Attiny85 and a Charlie-plexed button matrix

The most minimal handheld I could think of. 6 buttons that will probably do weird stuff, when you press more than one. Coin cell powered, I saw people use the oled and an attiny on a coin cell before. Never had an OLED on an Attiny85 before, so that was a good project for it. Always loved to look at the free form soldered things.

Skeleton Attiny85 Handheld | Boom, resin!

2019-04-11 17:45:50

done! :)

https://cdn.hackaday.io/images/8686791554997599463.JPG
https://cdn.hackaday.io/images/4411331554997605865.JPG
https://cdn.hackaday.io/images/3892361554997605921.JPG
https://cdn.hackaday.io/images/430291554997610043.JPG

Skeleton Attiny85 Handheld | Boom, resin!

2019-04-11 17:45:50

done! :)

https://cdn.hackaday.io/images/8686791554997599463.JPG
https://cdn.hackaday.io/images/4411331554997605865.JPG
https://cdn.hackaday.io/images/3892361554997605921.JPG
https://cdn.hackaday.io/images/430291554997610043.JPG

Skeleton Attiny85 Handheld | encasing it in resin

2019-03-23 18:35:15

I bought a bunch of things as a result of the feedback in the video comments and what people said before that already - basically a whole set for casting stuff in resin. Then I designed a case mould in 123D Design where I would cast the negative silicone mould in. The silicone came out wonderfully, but when I tried to pre-seal the switch and IC socket, the resin got into the parts, meaning I have to resolder them. It also seems as if the ratio wasn't mixed 100% right, as the resin is still very liquid, although it has been poured 3-4 hours ago. If it is not hard tomorrow morning, then I will mix up a new batch and remove the first layer of resin to start over. 

https://cdn.hackaday.io/images/512221553362143922.png
https://cdn.hackaday.io/images/6513581553362231666.png
https://cdn.hackaday.io/images/6903981553362131345.jpg

Skeleton Attiny85 Handheld | encasing it in resin

2019-03-23 18:35:15

I bought a bunch of things as a result of the feedback in the video comments and what people said before that already - basically a whole set for casting stuff in resin. Then I designed a case mould in 123D Design where I would cast the negative silicone mould in. The silicone came out wonderfully, but when I tried to pre-seal the switch and IC socket, the resin got into the parts, meaning I have to resolder them. It also seems as if the ratio wasn't mixed 100% right, as the resin is still very liquid, although it has been poured 3-4 hours ago. If it is not hard tomorrow morning, then I will mix up a new batch and remove the first layer of resin to start over. 

https://cdn.hackaday.io/images/512221553362143922.png
https://cdn.hackaday.io/images/6513581553362231666.png
https://cdn.hackaday.io/images/6903981553362131345.jpg

Skeleton Attiny85 Handheld | Revision for element14presents

2019-03-09 19:51:13

So I made a revision of this project for my first episode for element14 :)  

Skeleton Attiny85 Handheld | Revision for element14presents

2019-03-09 19:51:13

So I made a revision of this project for my first episode for element14 :)  

Skeleton Attiny85 Handheld | Conclusion

2019-01-08 22:15:48

At one point I had a thought that I could vary the time between asking the charlieplexed buttons and add a piezo buzzer to one pin to get some noises out of the little handheld. But then you would have to have sound all the time, because you want to scan the buttons as well.

It would make much more sense to have the buttons connected via a bunch of resistors to the ADC, so you get free pins and a way to add a buzzer. The project I named in an earlier log is a way better basis to do so. 

It was fun to solder up the prototype and build a charlieplexed "keyboard" for the first time, but programming a game for it wasn't really on the time table sadly. I enjoyed the positive feedback from everyone on social media though and might think of something at a later point. Thanks for having this contest, hackaday people!

Hehe... just noticed the countdown said "since" and not "until". Anyways, nice to add some thoughts afterwards then!

Skeleton Attiny85 Handheld | Conclusion

2019-01-08 22:15:48

At one point I had a thought that I could vary the time between asking the charlieplexed buttons and add a piezo buzzer to one pin to get some noises out of the little handheld. But then you would have to have sound all the time, because you want to scan the buttons as well.

It would make much more sense to have the buttons connected via a bunch of resistors to the ADC, so you get free pins and a way to add a buzzer. The project I named in an earlier log is a way better basis to do so. 

It was fun to solder up the prototype and build a charlieplexed "keyboard" for the first time, but programming a game for it wasn't really on the time table sadly. I enjoyed the positive feedback from everyone on social media though and might think of something at a later point. Thanks for having this contest, hackaday people!

Hehe... just noticed the countdown said "since" and not "until". Anyways, nice to add some thoughts afterwards then!

Skeleton Attiny85 Handheld | Working with the charlieplexed buttons

2019-01-08 22:08:07

I admit it was a bit trial and error development, but it worked out in the end.

#define pin_1 1
#define pin_2 4
#define pin_3 3

#define B_UP 0
#define B_DN 1
#define B_LF 2
#define B_RT 3
#define B_A 4
#define B_B 5

boolean pinChanged = false;
uint8_t pinstate = 0;
uint8_t pins[3] = { pin_1, pin_2, pin_3 };
uint8_t switches[6][2] =
{
  { pin_2, pin_1 },
  { pin_1, pin_3 },
  { pin_3, pin_1 },
  { pin_1, pin_2 },
  { pin_3, pin_2 },
  { pin_2, pin_3 }
};



void setup()
{
}

void loop()
{
  if (pinChanged)
  {
    pinChanged = false;
    if (pinstate & (1 << B_UP))
    { 
    }

    if (pinstate & (1 << B_DN))
    {
    }
    
    if (pinstate & (1 << B_LF))
    {
    }
    
    if (pinstate & (1 << B_RT))
    {
    }
    
    if (pinstate & (1 << B_A))
    {
    }
    
    if (pinstate & (1 << B_B))
    {
    }
  }

  for (uint8_t i = 0; i < 6; i++)
  {
    deactivate_all();

    // set pin states for button
    pinMode(switches[i][0], INPUT_PULLUP);
    pinMode(switches[i][1], OUTPUT);
    digitalWrite(switches[i][1], LOW);


    if (pinstate & (1 << i))
    {
      if (digitalRead(switches[i][0]) == HIGH)
      {
        pinstate &= ~(1 << i);
        pinChanged = true;
      }
    }
    else
    {
      if (digitalRead(switches[i][0]) == LOW)
      {
        pinstate |= (1 << i);
        pinChanged = true;
      }
    }
  }
}

void deactivate_all()
{
  for (uint8_t i = 0; i < 3; i++)
  {
    pinMode(pins[i], OUTPUT);
    digitalWrite(pins[i], HIGH);
  }
}

Skeleton Attiny85 Handheld | Working with the charlieplexed buttons

2019-01-08 22:08:07

I admit it was a bit trial and error development, but it worked out in the end.

#define pin_1 1
#define pin_2 4
#define pin_3 3

#define B_UP 0
#define B_DN 1
#define B_LF 2
#define B_RT 3
#define B_A 4
#define B_B 5

boolean pinChanged = false;
uint8_t pinstate = 0;
uint8_t pins[3] = { pin_1, pin_2, pin_3 };
uint8_t switches[6][2] =
{
  { pin_2, pin_1 },
  { pin_1, pin_3 },
  { pin_3, pin_1 },
  { pin_1, pin_2 },
  { pin_3, pin_2 },
  { pin_2, pin_3 }
};



void setup()
{
}

void loop()
{
  if (pinChanged)
  {
    pinChanged = false;
    if (pinstate & (1 << B_UP))
    { 
    }

    if (pinstate & (1 << B_DN))
    {
    }
    
    if (pinstate & (1 << B_LF))
    {
    }
    
    if (pinstate & (1 << B_RT))
    {
    }
    
    if (pinstate & (1 << B_A))
    {
    }
    
    if (pinstate & (1 << B_B))
    {
    }
  }

  for (uint8_t i = 0; i < 6; i++)
  {
    deactivate_all();

    // set pin states for button
    pinMode(switches[i][0], INPUT_PULLUP);
    pinMode(switches[i][1], OUTPUT);
    digitalWrite(switches[i][1], LOW);


    if (pinstate & (1 << i))
    {
      if (digitalRead(switches[i][0]) == HIGH)
      {
        pinstate &= ~(1 << i);
        pinChanged = true;
      }
    }
    else
    {
      if (digitalRead(switches[i][0]) == LOW)
      {
        pinstate |= (1 << i);
        pinChanged = true;
      }
    }
  }
}

void deactivate_all()
{
  for (uint8_t i = 0; i < 3; i++)
  {
    pinMode(pins[i], OUTPUT);
    digitalWrite(pins[i], HIGH);
  }
}

Skeleton Attiny85 Handheld | Making the Attiny85 work with OLED in Arduino

2018-12-23 14:40:05

You need this to make the Arduino IDE be able to flash ATTINY based boards

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

And this worked for me when trying to make the OLED run

https://www.instructables.com/id/ATTiny85-connects-to-I2C-OLED-display-Great-Things/

Skeleton Attiny85 Handheld | Making the Attiny85 work with OLED in Arduino

2018-12-23 14:40:05

You need this to make the Arduino IDE be able to flash ATTINY based boards

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

And this worked for me when trying to make the OLED run

https://www.instructables.com/id/ATTiny85-connects-to-I2C-OLED-display-Great-Things/

Skeleton Attiny85 Handheld | so it begins

2018-12-11 13:38:35

nice start so far :) I will try to port the games from @Daniel Champagne for the #Tiny Joypad by @megazoid to this handheld, because I made the buttons work yesterday! With a trick I might be able to add some sound, but not like them. I really enjoy their take on the attiny85 handheld and the 3D printed case with a swappable / rotating display.

The broken OLED is replaced, I've added some more of the threads that I made stronger with the help of liquid super glue! The tweet that I almost deleted because I feared spamming people got pretty crazy in comparison of my usual tweets.

https://twitter.com/davedarko/status/1072076882957484033

Skeleton Attiny85 Handheld | so it begins

2018-12-11 13:38:35

nice start so far :) I will try to port the games from @Daniel Champagne for the #Tiny Joypad by @megazoid to this handheld, because I made the buttons work yesterday! With a trick I might be able to add some sound, but not like them. I really enjoy their take on the attiny85 handheld and the 3D printed case with a swappable / rotating display.

The broken OLED is replaced, I've added some more of the threads that I made stronger with the help of liquid super glue! The tweet that I almost deleted because I feared spamming people got pretty crazy in comparison of my usual tweets.

https://twitter.com/davedarko/status/1072076882957484033