Development

71 posts

Controlling a 10-bit Digital Potentiometer via SPI with Arduino

1. A brief introduction to the Serial Peripheral Interface (SPI) The Serial Peripheral Interface a.k.a SPI or four-wire serial interface is a full-duplex serial data protocol used by microcontrollers for communicating with one or more peripheral devices. Devices communicate in master/slave mode and there are four logic signals: – MOSI: Master Out Slave In, is …

Constants.h considered harmful

It’s common to use a centralised “Constants” class where you gather together lots of constants for your app. For example, in Objective-C you’ll often have a big file Constants.h full of lines like this.  #define DEBUG_MODE NO#define APP_URL @"http://itunes.com/apps/mycoolapp"#define CHARACTER_ANIMATION_TIME 2.0f#define FOOTER_IMAGE @"mycoolapp-footer.png"#define FONT @"Helvetica-Bold"  Don’t do this. Why? 1. It increases compile times significantly. …

Adding iOS5 native Twitter support to your cocos2d app

In iOS5, Apple introduced native Twitter integration via the “Tweet Sheet” (aka TWTweetComposeViewController), allowing you to easily implement Twitter in your iOS app without worrying about all the heavy lifting. If you tried implementing Twitter support in the past and found yourself lost in a sea of OAuth source files, trying to handle authentication yourself, …