Hack Your Roshamglo Badge
Hardware Overview
The Roshamglo uses the following:
- ATtiny84
- IR LED
- IR receiver with built-in 38kHz demodulator
- USB programming
- Programmable red and green LED
- Power switch
- 5-way switch for input
- Reset switch
- 6 AAA PTH battery clips
- 3 AAA batteries for power
The brains behind the Roshamglo is an ATtiny84, a lightweight Arduino-compatible microcontroller. The ATtiny84 comes with the following:
- 8kB of flash memory for our program (~6kB after the bootloader is installed)
- 512B of SRAM, which stores our variables used in our program
- 512B of EEPROM
- 12 I/O pins MAX (the Roshamglo breaks out 9 of these pins)
- 10-bit analog-to-digital converter, which can be used on 8 pins
For details about what each pin is able to do, refer to the table below.
Pin | Analog or Digital | Additional Uses | Roshamglo Uses |
---|---|---|---|
0 | Both | Analog Reference | 5-way switch down |
1 | Both | -- | 5-way switch right |
2 | Both | -- | 5-way switch up |
3 | Both | -- | IR Receiver |
4 | Both | SCK, SCL | 5-way switch left |
5 | Both | MISO, PWM | IR LED |
6 | Both | MOSI, SDA, PWM | 5-way switch center |
7 | Both | PWM | Green LED |
8 | Digital | PWM | Red LED |
Each of these pins has been broken out to the edge of the board to make customization easy! If you would like to use any of these pins for something other than what it's currently connected to, we provided jumpers that can easily be cut with a hobby knife. The only pins that do not have a jumper on them are the pins used for the five-way switch. The pins for the switch use the ATtiny's internal pull-up resistors, so as long as the switch is not closed, the pin can be configured in any way you'd like without having to cut traces.
One Important Feature Missing
If you hadn't noticed in the pin description, there was no mention of RX or TX pins. This is because, unfortunately, the ATtiny84 doesn't have a hardware UART. The UART is used for serial communication, whether it's for programming or printing messages to the serial window. You might be thinking, "But doesn't the USB connector provide communication between the ATtiny and the computer?" You're right; it does. To keep the bootloader size as small as possible, the bootloader only allows for USB programming. For serial debugging, you'll need a USB cable and a USB-to-Serial adapter, and the SoftwareSerial library to send messages to a computer. You can learn more about serial communication here.