Posts

Showing posts from 2015

Touchboard scrolling

Image
Using proximity sensor for scrolling documents What For Christmas I bought myself a touchboard from bareconductive . It's a board with Atmel microprocessor ATMega32U4, 12 Analog inputs, 20 digital pins etc. It's from arduino family so you can use arduino IDE for your projects. This board comes with special conductive paint called "bare-paint". In combination with 12 analog inputs you can create touch or proximity sensors. First touch When I first tried the proximity sensor as a volume setting, it was like some kind of a magic, haha. I was positively surprised about the proximity precision. There SDK comes up with about 10 examples. The libraries are quite good and simple. You can do anything with a few lines of code. If you want to use the board for sound effects there are two options - mp3 or midi. MP3 files can be replaced on miroSD card and for midi, there are more than 100 musical instruments. To toggle between midi and mp3 version you have to join two c

Programming MCU

Image
Programming Atmel ATmega8l microcontroller Intro For the next article I've decided to go further into the hardware. For my next project I've chosen to program a micro controller (MCU). I've got no experience with MCUs before and this article will show my whole process. First steps My colleague advised me a usb-avr programmer which is compatible with AVR Atmel micro controllers. So I ordered this usb-avr programmer, ATmega8L microcontroller, some resistors, leds and a breadboard. I prefer using IDEs (syntax highlights, build from one place, save time and trees) so I chose Eclipse. There is a nice tutorial how to setup an Eclipse plugin for avr programming, but mainly you just need to install these libraries. gcc-avr -> library for use with GCC on Atmel AVR micro controllers binutils-avr -> cross compiling version of GNU binutils gdb-avr -> GDB for (remote) debugging avr binaries avr-libc -> C library for use with GCC on Atmel AVR micro controlle

Sms grocery list

Image
Widget with grocery list created by your received messages Why? Many times I faced the problem when someone has sent me a message with a list, what to buy on a way back home. My first thought was to create an invisible app that reads incoming messages and puts their content into Google Keep messages and also shows it in a widget. After some googling I found out that Google Keep doesn't support API for the 3rd parties. So I decided to create an app with this feature. What did I do? Application contains a receiver that allows to read all new messages. After the message is received it searches for a key words in the message. You can set up a multiple keywords to look for in a message. Another option is to set up a reminder. Reminder shows notification at the specific time in a day where at least one message was received. You can find this under the settings in a side menu of the application. Second part of the application is a widget. Widget shows you the list of all the rec

Sony Smart Watch development

Image
Creating app for Sony Smart Watches Intro In the next few lines we will talk about Sony Smart Watches first model . Currently, there is the third edition of Sony Smart Watches out. Recently I had an opportunity to try some development for this Smart Watches. I bought 2 Smart Watches at a local flea market (for 3 EUR each:). They were without an adapter and a wrist strap. Because Sony only created a proprietary cable I had to make one by myself. I used some old USB cables and follow this link . If you will ever face the same problem, don't bother to create a cable with all 4 pins. You only need two pins for charging (the first is VCC, and the last is ground - from left to right). Setup AFAIK there is no common android SDK for watches. Each company has its own SDK package. To run some official apps, you need to install " Smart Connect " in the first place that allows you to pair watches with your device. Now you can install apps from Google Play Store. Note that non

Working with android contacts

Detecting changes in Android contacts Intro In next few lines we will talk about detecting changes in Android contacts. Android Os provides a storage for contacts called Contacts Provider. Contact Provider allows you to manage an access to a structured set of data and standard interface that connects data in one process with code running from another process. Structure Android Contacts structure consists of many tables, here are few of them. ContactsRaw table: (listing important rows) _id - RAW_CONTACT_ID account_name - e.g. email address account_type - account type e.g. com.google.com deleted Table ContactsContract.RawContacts.CONTENT_URI contains original contacts. This table mainly stores raw_id. The contact details are stored in Contact Contract table. Contacts table: (listing important rows) _id - CONTACT_ID (this id refers one group of raw_contact_id ) lookup - link to all contact details and contact in this table Table Contacts.CONTENT_URI consists of

Fb vs G+ android sdk

Recently I had an opportunity to implement facebook and google plus login into android application. So i decided to write a small comparison of those two (fb v4.3, google services v4.3.23) Google plus server side setup required (create new app) adding generated key into android manifest implementation consists of a few methods, activity implements ConnectionCallbacks and OnConnectionFailedListener Facebook server side setup required (create new app) adding generated key into android manifest, and declaration of one activity sdk is not compatible with eclipse (there can be found an easy workaround on stackoverflow) xml customization of fb button can be done only by overwriting styles in Fb SDK (which is not a recommended solution) implementation consists of only a few lines of code (initialization, button listener, onActivityResult) if user enters invalid fingerprint of debug/release key, the error shows value of your key (very helpful) Conclusion Apart from two fb

Thermal printer perl library

Image
Adafruit thermal printer perl library What Last month I've created a web GUI for my raspberry Pi thermal printer. After spending some time with testing, I was still unable to do several basic operations like print text with diacritics or create my own characters etc. So I decided to create my own library. I found out that there are plenty of them in python or C, but only few in Perl (with missing methods that I expected). What I did I've created a Perl library for Adafruit thermal printer . I read the original printer documentation and wrote a method for almost every command mentioned. The library consist of all default methods for altering font, barcode and image methods. I also did a few more custom methods: printing images with gradient effect aligning image (if image is more narrower than printing paper) registering custom font from bitmap image Notes During the testing I gathered some facts that might be interesting: The printer buffer is limited (exact

Thermal printer with RPi

Image
Connecting thermal printer to Raspberry Pi B+ with server side GUI What is thermal printer? Thermal printers are now widely used for printing recipes in almost every store. The printer uses special paper that can be written without ink just using heated tip. You can purchase one in any e-shop. There are many tutorials , on how to connect it to raspberry pi. You should use an adapter with right level of Amps, or you experience bleached or no results. What I did I connected the thermal printer to the raspberry-pi and repeatedly requested server for new content. I used library in python that allows me to print images, barcodes and formatted text. Then I created a web gui for creating printer content like: formatted text, canvas with few features, sudoku generator with variable level of difficulty.      

LG G3 quick circle case app

Image
Using LG G3 circle case SDK to create a demo application What is the circle case? LG provides a special case for it's G3 model. This case allows users to use the NFC technology, wireless charging with Qi standard (only for European market) and also has a circle hole on it's upper case side. This hole allows users to control about 1/3 of their display with a customized GUI app. LG G3 SDK LG released a small SDK for developers to access the functions of their circle case. To sum it up, there is a hidden magnet inside the case and a small sensor behind the screen part. So the SDK just provides a receiver for detecting opening/closing of the case. public class QCircleActivity extends Activity { // [START]declared in LGIntent.java of LG Framework public static final int EXTRA_ACCESSORY_COVER_OPENED = 0; public static final int EXTRA_ACCESSORY_COVER_CLOSED = 1; public static final String EXTRA_ACCESSORY_COVER_STATE = "com.lge.intent.extra.ACCESSORY_COVER_

Owi robotic arm with RPi

Image
Owi robotic with RPi controlled by keyboard, websockets, openCV How did it start Recently I get a Raspberry Pi (Model B+) as a present for my 27th birthday. First thing I did was that I played with the GPIOs (general purpose input/output) pins that can be programmable. The first language I found that supports GPIOs, was python library RPI.GPIO. So I tried a few basic circuits. Toggled some leds, RGB-led, speaker beeps and so on. Few months earlier a colleague at work showed me a web page with some robotic arms that were looking catchy. The closest shop that sales any robot arms, was in Czech Republic with only one model - Owi. So I decides to get it. Connecting to RPi The first task was to connect the Owi-arm to the Raspberry Pi. You can find the Owi robotic arm with a USB or a joystick. Mine's get a joystick controller as an output, so I had to find how to connect it with RPi. After few hours of googling I found a video that showed RPi how to toggle relays with RPi. So I