Face Tracking Turret

pan-tilt-mountFace tracking turret uses OpenCV framework for face recognition, the project is written in Python. The face center coordinate is sent via serial interface to Arduino. The coordinate is translated into horizontal and vertical angles that are used to position the servos on the pan/tilt mount.

Continue reading

Thread Safe Design

threadsThread safe design is achieved when operations on certain shared data structures can be safely executed from multiple threads at the same time. There are multiple ways to achieve thread safety using synchronisation tools provided by the iOS. They mostly consist of mutex locks (NSLock class or @synchronized directive) or the use of queues and GCD.

Continue reading

Circlemania – iPhone Game

circlemania_iconCirclemania is a visual perceptive game in which you have to find the last emerging circle among all other circles that have appeared previously. You are limited to 5 seconds for each turn. The faster you find the correct circle the more points you get.

Check it out at: https://itunes.apple.com/app/id466007126

Continue reading

CMMotionManager and Low-pass filter

lowpass_filterIn Catchup, an iPhone game I recently published on the app store, I am using device motion sensor in order to move the main character. In order to make the character movements smooth I’m using a low-pass filter.

Low-pass filter provides a smoother form of a signal, removing the short-term fluctuations, and leaving the longer-term trend.

Continue reading

CatchUp – iPhone Game

catchup-iconCatchUp is an iPhone game I created using cocos2d framework. The game concept is very simple. Tilting the device you’re moving the character and avoiding other game characters chasing you. The more time you succeed in avoiding the chasing characters, the better the score.

Check it out at: https://itunes.apple.com/app/id878533140

Continue reading

LTimer – iOS NSTimer helper class


LTimer is a simple iOS NSTimer helper class that allows easy dispatch of different NSTimer configurations. Supports blocks and method invocations.

Check it out at my GitHub repo: https://github.com/lukagabric/LTimer

Continue reading

LPlaceholderTextView – UITextView subclass with placeholder

lplaceholdertextview_placeholder_cropLPlaceholderTextView is a UITextView subclass with placeholder text and placeholder text color properties. In order to use in your project just import the LPlaceholderTextView class and use it as in the code sample below.

LPlaceholderTextView is available on my GitHub repo:

  • lplaceholdertextview_placeholder
  • lplaceholdertextview_text

Franko – Arduino Self Balancing Robot

FrankoMy latest Arduino DIY project is a self balancing robot.

Arduino Uno R3 microcontroller board is used for this project. MPU6050, an 6DOF IMU (with accelerometer and gyroscope) is used to get the angle and L298N motor controller board controls the 2 motors.

The motors are 12V 122rpm and the wheels are 8cm in diameter.

Robot size is 17x10x30 cm. Three plexiglas plates are used to hold the frame and parts. Standard PID controller is used to control the robot. To tune the PID controller parameters 3 potentiometers are used.

Continue reading

LASIImageView – download image with progress indicator

LASIImageViewSampleLASIImageView is a UIImageView subclass that supports asynchronous image download with different progress indicators. It is possible to choose among three different progress indicator styles, with or without percent text.

In order to use it, just add LASIImageView class files to the project and set the instance imageUrl property to download and display the image.

LASIImageView includes shared appearance settings. Appearance can also be specified for any LASIImageView instance, overriding the global appearance for that object.

ASIHTTPRequest is used for image download. Request settings can be set for LASIImageView instances globally, or per instance, overriding the global settings.

Continue reading

iOS Data Model using Core Data

contacts-screenshotLCDDataSource is a sample project hosted on my GitHub repo that presents a simplified process of getting remote data and storing it using Core Data framework. The data source implementation itself is in the LAbstractASIDataSource class and LCDParserInterface.h defines a protocol that the parser must conform to. Other classes are listed below. The model uses a Root context for async data persistance (saving data in background so main thread is not blocked). Main context is used on the main thread – presenting data to the user (UI). Worker contexts are used by the data sources and parsers for asynchronous data fetching and parsing. There is only one Root and one Main context, but multiple Worker contexts – one for each data source. Contexts are in a parent-child relationships: Root->Main->Worker(s). Any Worker context may be easily merged into Main context or discarded at all times without disturbing the main context.

Continue reading