Sunday, 22 July 2012

Anybody who has succeeded in using MKNetworkKit?

I am having a bit of trouble following this. I am using XCode 4.2 on Snow Leopard

I am trying to evaluate using MKNetworkKit to replace some hairy network code I wrote a year or so ago....

So I am testing out the Upload Photo project at FiestyGoat

I used GitHub to download MKNetworkKit to my documents folder.

I built MKNetworkKit-IOS

I started by creating a new workspace (Uploader) and then a new project (Upload) as a single view application using storyboards. The project is in Desktop/Xcode Projects/Upload.

I then dragged the MKNetworkKit subfolder (i.e. the one that contains Reachability & Categories) to the project
copying the files across

I then dropped into Finder and removed the two unwanted files (NSAlert+.....h/m) and cleaned the project.

Then I modified Upload-Prefix.pch

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    #import "MKNetworkKit.h"

Then I tried to build it and I get an error "'MKNetworkKit.h' file not found"

Now I am pretty sure that I am missing something pretty simple but cannot figure out what. I am pretty sure that if I was supposed to change project settings somebody would have mentioned it.....

Any idea what my stupid error is?

Wednesday, 18 July 2012

Using an LED as a light sensor

We are working on Power Control Systems now. So we were sitting in the library and we started talking about solar panels and how they worked.

It was around this point that I remembered Jolyon's habit of using things backwards - like using a loud speaker as a microphone and using a 12v transformer to create 240V from a chopped 12V supply...

And I remembered reading about using an LED back to front to act as a light sensor. So I rigged up this  little circuit as a quick demo right there in the library....
LED as a sensor

A few lines of code and it was up and running........

Pretty simple eh?

I just used my iPhone as a light source using Torchlight - one of the many free apps that use the phone's LED... and the results were pretty astounding.....

This must be one of the most simple Arduino circuits and it works because when light hits the PN junction of the LED it generates a SMALL voltage that you can read on the analog input pin.

Because the voltage is so small, we need to add upp a large number of cycles to ensure that our reading is not from random noise.

Wednesday, 11 July 2012

Ethernet, LCD's, Keyboards and more

We've been kinda busy.....

Alvin at Hackerspace arranged with SGBotic to promote the courses on their website and the response was kind of fantastic.... and agreeing to it blew my idea of starting an Arduino store right out of the water but to be honest it is quite a relief.

We will still be putting some Arduino stuff together (special kits maybe) - and I am seriously thinking of doing something to jump start the Malaysian Arduino scene but I will not bite the hand that feeds me especially when they are getting me some robot toys to play with....

Since the last post we have had a couple more intro courses which were really well attended and the long awaited "Communicating with the Arduino".

In "Communicating with the Arduino", the second of our intermediate classes, we left our students to make some of the decisions - e.g. pin assignments. As expected, some guys, made the same mistakes that I did (and others) which was an excellent opportunity to teach more debugging techniques as well as some underlying principles.

And then - really cool - I was asked to give a talk to IOS Dev Scout about using the Arduino with the iPhone. This meant it was time to start preparing our new intermediate class which I had been thinking about for sometime about "Arduinos on the net"

I presented an Arduino acting as an HTTP server, a TELNET server and a custom protocol server. In the last case I made the Arduino emulate a Cytech Comfort Home Automation System  and control it with the IOS App that I wrote for Cytech last year.

Finally we logged into the Cytech demonstration system (a Dolls House in their office in UBI with loads of lights) and arbitrarily turned lights on and off while watching it on a live webcam feed.

So keep tuned - we will try to present this course on a Saturday afternoon in the next month.