| pcb | ||
| .clangd | ||
| .gitignore | ||
| DEMO_LANDING.md | ||
| i2c.h | ||
| main.c | ||
| Makefile | ||
| README.md | ||
| simulation.h | ||
| TODO.md | ||
| USI_TWI_Master.c | ||
| USI_TWI_Master.h | ||
Physics Gadget (v3)
This is the 3rd hardware revision of my "physics gadget". This circuit uses an ATtinyX5 microcontroller to simulate objects bouncing around in a void, affected by the user shaking the devicee
Parts Required
- The circuit board (the schematic, design, and gerber files are available if you want to order it)
- 1x ATTinyX5 (ATTiny45 or 85 recommended, code will need to be adjusted to work on 25 and 45)
- 1x GY-521
- 1x Adafruit 1079 or compatible (same controller) 8x8 LED matrix
- 1x 100nF decoupling capcitor for ATTiny
- 4x 10-100k resistors for reset and button pull-ups and pull-downs
- 1x some power source with leads you can solder to the PCB (I used a switched AA battery case)
- A programmer for the ATTiny
- The firmware
If you use the ATTiny85, you can use the precompiled firmware
Building the firmware
Dependencies
make avr-gcc avr-libc avrdude
To build the firmware, first set the variables to the correct values in the Makefile for your use case.
DEVICE = attiny85
PROGRAMMER = usbtiny
FUSES = -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m
CLOCK = 8000000
Make sure to set the correct values for your microcontroller, it's clockspeed, and fuses. The defaults are fine, but if you have a different programmer you'll need to specify that..
You can also modify the various pre-processor directives in main.c to change the behavior and sensitivity of the device.
Next, run
make flash
To compile the firmware and program it using the programmer attached to your computer.