Posts

Showing posts from February, 2016

Self playable game on smartphone

Image
Connecting Android to servo motor via USB OTG Hardware I recently put together a Lego phone holder that can be rotated in one direction (y-axe the longer side of phone). The end of the holder is attached to a servo motor. Servo motor is connected to Android smart phone with USB OTG via motor module. Motor module is controller that can control up to 24 servo motors and runs on 5 volts. Software The module controller part has already burned its own protocol. It was a combination of rotation and speed separated by new line symbols. Second part was Android application that sends messages via serial protocol to this servo-module. I used an example of USB serial communication with Arduino and rewrote it for my device. Game For this exercise I chose a game that I made about year ago. It is a simple game that uses accelerometer to move the rocket through gates. Leaning device to sides allows you to control the position of the rocket. The goal is to run through as many gates as y

Avr clock

Image
Wall clock made of avr mcu and led display using internal timer Idea The main goal was to try numeric LED display with MCU, so to make it a little bit more interesting I decided to create a clock that shows time in digital and analogue way. I used Atmega16L MCU because I needed 26 I/O pins (12 for numeric display, 12 for 2mm LEDs and 2 for buttons). The clock has got two buttons - one for adding hours and one for minutes. 2mm LEDs around edge shows seconds while numeric display inside shows hours and minutes. Display I bought my display from ebay without any data sheet, but it is almost the same for all kinds of displays. You can easily find the right combination of pins. Four 7-segment digits are controlled via 12 I/O pins. Each digit is made of 8 parts (7 for number, 1 for dot). The other four pins are ground for each number. So to light up 4 different digits you have to toggle between all of them quickly. Timers A timer is a simple counter. The ATmega16 has two 8 bit and