This blog is dedicated to all stuff around IT, new technologies, creating
prototypes, learning new things and so on ...
Self playable game on smartphone
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
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 you can. The speed is increasing within entered gates.
Steps
My first idea was to detect the values of maximum rotation to both sides. Then to use this values and dynamically calculate all rotations of holder. But after few changes in my holder construction I realized that my configuration is a little bit different each time. So I created a calibration method that runs at start up and detects the limit values by itself. Then during the game the values are recalculated from these limits. For better understanding please watch the video below.
Result
The practical usage of "self playable holder" is literally none. But if you look at it as an exercise, it is a nice introduction to connecting an android to servo motor.
Computer vision exercises with preprocessing Before the next project I decided to do some computer vision exercises. Each example is based on a simple logic image preprocessing. No data structure or learning is required. Dice I got this idea while browsing the net. I was curious about how hard can it be to write such a script. I'll describe the algorithm in steps. movement detection : Comparing few frames with thresholds gives us the information, whether something is moving in the frame. Adding some small time frame after the movement stops gives us more precise information. remove background : Thresholding gray frame removes the background and gives us binary image with objects cropping the objects : Using contours to detect object and then separate them by cropping. detecting dots : Inverting the image we get objects that can be again simply detected using contours. filtering dots : If dice is visible also from the side therefore dots from that side can be recogn
Using proximity sensors for playing midi tones combined with LED visualization Description The aim of this project was to create a table sized device with multiple proximity sensors that can play midi tones. Each sensor had a few LEDs to show hand distance above the table. This table could be used by one or more persons at once. Hardware setup First I created a prototype from a cardboard to test sensors and some logic behind. Than I ordered a customized plottered sticker with a design which was painted with bare conductive paint. Afterwards I drilled some holes and connected the touchboard with 7 arduino Nanos. Each arduino was connected to 13 LEDs diodes. At the end I added two potentiometers. One for controlling volume and one for changing notes setup. Programming Programming consists of two parts. Master(touchboard) program that reads values from proximity sensors and sends messages to slaves(arduinos). Second program for slaves that reads messages from m
In this article we're going to describe how to recognize a skateboard trick using a gyroscope. This sensor is already present in most of the smartphones but in case you are not familiar with it, here is a description . Before we begin, small disclaimer. This project was originally as a part of hackathon that was used with Slido and the purpose was to confirm that it's possible to recognize a trick using a gyroscope. For the sake of simplicity of this project we're not considering skater's stance on a board and we're only trying to recognize 2 simple tricks. So, let's begin by splitting the problem into several smaller ones. We need to record the trick, store it, describe it, understand it, and then of course recognize it. Recording the trick Let's start with the trick recording. To have a precise data we need to have a device with a gyroscope that is attached directly to a skateboard. We need to place it on the bottom of the board, otherwise it might interfe
Wow, that's useful :)
ReplyDelete