So here’s the deal for the next few months.

I’m dusting the cobwebs off this blog to share with you every week a blog post about the development of a major iOS application. I hope you enjoy. The first is below. All my posts and my classmates posts can be viewed at http://blog.codecadets.com/ 

PLANNING, PLANNING AND MORE PLANNING.

by LOCHIE on AUGUST 13, 2012

I’m beginning to see more and more the usefulness of good planning. I’ve always been the kind of person to dive right in, and figure it out as I go along. Why waste time planning when you can be making or doing? But I’ve learnt recently that planning can be quite a good thing after all. Instead of wasting time it can help you structure your ideas into something can be achieved more quickly and easily. It can actually save time instead of waste time. As I’ve worked through planning out my app I’ve found this to be true more and more. What looks like a hugely complicated idea from the outside can be simplified somewhat if it is broken down into chunks. If you focus on doing one medium sized thing well you will do much better than if you focus on doing little things all over the place. Planning is very useful indeed.

There’s been one major challenge that I’ve encountered as I’ve been planning my app. Trying to figure out how to balance the needs of various end users is very tricky indeed. Take for example a cooking app which shows recipes. User A likes making sushi. User B likes making spaghetti. Because of this range of interests and uses for the app you then have to consider how much weighting you need to give to each type of food in the recipe library. This requires surveys and careful analysing of the market before settling on a compromise. There may be many people who like sushi but even though they are in the minority, spaghetti people may have more iPhones. Though with my app it’s a lot less about giving weighting to libraries of information and a lot more about omitting or including features. Does Person A really need this feature? Or would they be happy with the feature more suited to the larger group of people classified as Person B? These are difficult conundrums that can only be solved with careful planning and consideration. Hmm.

Advertisements

First iPhone App

I am learning iOS  development as a full time subject at school like I did electronics last year. Yep, I go to school and learn programming. Pretty f$#^@&g awesome. We’d been doing terminal apps to learn the basics of objective c when we had a one-day workshop from apple engineers. Real apple people. The people emerged from the shadows with a holy white glow. No, they were really nice down to earth people actually. After they showed us iBooks author in the morning (it has a VERY hard to solve bug –  changing the background colour of a page) they moved on to some more advanced stuff – iOS dev. I was expecting some big thing where you have to code all this stuff to get it to display a black screen. It had to be harder than little terminal apps right? He dragged and dropped a text field, linked it up, pressed run and there was a hello world! I was like REALLY? Is it really that EASY?

This was awesome. I’d never seen anything this easy. So I mucked around for the rest of the workshop making some little things with the button and text outlets. We did a map example which everyone thought had a critical bug. It turned out to be that the simulator was set to simulate every single apple store location. So it was flying around before the map image was loaded. Making it look like the animation feature was stuffed.

I got home from the workshop and I was like, make something, anything, now! There’s some kids on my bus who talk about Minecraft EVERY day. And a lot of kids in the junior school robotics class that I teach are crazy about the stuff. I decided to make something minecrafty for them. I settled on making a little app that allows people to view all the splash texts and see what their meanings are. If you don’t know what the splash texts are go here: http://www.minecraftwiki.net/wiki/Splash . They’re basically just references to popular culture, games and in jokes. There’s 304 of them and one is randomnly displayed each time you load the game in a bright yellow flashing font.

So I set about making a little browser for these. Luckily all the splash texts are stored in a text file called splashes.txt found in minecraft.jar. So all I had to do was get the text file out, write some code to convert it to an array and print out the result. I also added the ability to view what each text means on the wiki page, and the text number. It was made as a project to learn how to make, debug, refine, submit and manage an iPhone app so I know what I’m doing when I want to make something good. The app is rated 17+ because apple has a silly rule that anything that has web access is highly dangerous. I think because it’s 17+ it’s banned in Korea or something. It’s a free app available for download from the app store.

It should top 50 downloads by the end of today. I don’t understand who would download it. Honestly.

Get the app here: http://itunes.apple.com/us/app/mc-splashes/id514227231?ls=1&mt=8

Some of my favourite reactions:

“So, what does this actually do?” Nothing really.

“Are you serious?” Yep. Vaguely.

“You’re going to charge people money for this aren’t you? Yes?” Um, no.

“Can’t you just view the wiki page?” Well, yeah but it doesn’t display them in the font and colour.

 

Bruce

I came up with this little guy when I was on a long car trip last weekend. I might make a game for him one day as a little project. Probably after I finish this big arduino competition entry I’ve got planned. Also, I’m still waiting for parts for my competition entry so not much is happening right now sadly. I think I’m beginning to become more of a software guy. Though this competition might bring back some of the excitement. Time will tell. I have just about had enough of the lack of control available in a wordpress.com blog. I’m thinking about maybe moving it over to a proper server sometime so I can put up files and other stuff and program the website how I like without having to stick to a pre-made theme.

Bruce

Instructables Arduino competition

I was actually stuck in a bit of a tricky situation deciding whether to spread the word about this cool competition. You see, if I didn’t spread the word I would have had more chance at winning as there would be less entries. But, that would make me feel kind of bad for not telling you guys about cool stuff. So I decided to tell you about it and hopefully get some more people into this stuff with the incentive of a big, juicy DSLR.

So, on to the competition details. There is a DSLR, kindle fire and an Arduino mega on offer as prizes. And it’s open to Australians! How is that even possible? Tech competitions are never open to us…. I’m very confused. Anyway, there’s not that many entries (yet) so I think it’s a good idea to make a project quickly so it can get the early votes before it gets lost in the pages of projects. I would tell you some of my ideas but I’m not that generous.

Check the competition out here: http://www.instructables.com/contest/arduino2012/?show=INFO

An update on some stuff

Okay so I went away for the weekend for a cycling race and on the car drive out I mostly just messed around with my new macbook air (more on that later). On the way back when I was extremely tired (as one is after racing the national champion) I remembered that I’d promised to write up some better behaviour code for that little robot I built.

The end result of that lazy little 20 minutes of code writing is pretty simple. Basically the program picks whether the robot is going to be happy, sad or neutral when the door is opened. Once it has determined that it simply shakes it’s head, blinks it’s eyes or plays a tune based on how happy it is. There are varying levels of action for each part of the robot to correspond with how happy or sad it is. Anyway, here’s the code so you can get a feel for what it’s like:

//Servo robot behaviour program
//Created by Lochie Ferrier to control a small robot
//the servo control information
#include <Servo.h>
Servo head;
//the mood of the robot when the program runs for the first time
String mood=”happy”;
//initiate variables
int selector, speakerPin, lastReading, pos,range,ledPin,lastPitch,pitch,additive,timeAfterAction=60000;
void setup(){
head.attach(9);
Serial.begin(9600);
}
//HEAD FUNCTIONS
//function to shake the head slowly
void headShakeSlow(){
pos= random(0,180);
head.write(pos);
delay(3000);
head.write(0);
delay(3000);
}
//function to shake the head moderately
void headShakeMedium(){
pos= random(0,180);
head.write(pos);
delay(2000);
head.write(0);
delay(2000);
}
//function to shake the head fast
void headShakeFast(){
pos= random(0,180);
head.write(pos);
delay(1000);
head.write(0);
delay(1000);
}
//LIGHT FUNCTIONS
void eyeBlinkSlow(){
digitalWrite(ledPin,HIGH);
delay(1000);
digitalWrite(ledPin,LOW);
}
void eyeBlinkFast(){
digitalWrite(ledPin,HIGH);
delay(500);
digitalWrite(ledPin,LOW);
}
//SOUND FUNCTIONS
void melodyLow(){
pitch=200;
int count=0;
if(count<10){
range=50;
additive=random(-range,range);
pitch = pitch+additive;
tone(speakerPin, pitch);
pitch=lastPitch;
count++;
delay(500);
noTone(speakerPin);
}
}
void melodyHigh(){
pitch=400;
int count=0;
if(count<10){
range=50;
additive=random(-range,range);
pitch = pitch+additive;
tone(speakerPin, pitch);
pitch=lastPitch;
count++;
delay(500);
noTone(speakerPin);
}
}
void loop(){
if((lastReading+2)>analogRead(0)){
selector=random(0,2);
if(selector==0){
mood=”sad”;
//perform sad behaviour for the robot
Serial.write(“:(“);
eyeBlinkSlow();
headShakeSlow();
melodyLow();
//this function ensures the robot does not continue to bug me once it has finished
//it’s little hello
delay(timeAfterAction);
}
if(selector==1){
mood=”neutral”;
//perform neutral behaviour for the robot
Serial.write(“:|”);
eyeBlinkSlow();
headShakeMedium();
melodyLow();
//this function ensures the robot does not continue to bug me once it has finished
//it’s little hello
delay(timeAfterAction);
}
if(selector==2){
mood=”happy”;
//perform happy behaviour for the robot
Serial.write(“:)”);
eyeBlinkFast();
headShakeFast();
melodyLow();
//this function ensures the robot does not continue to bug me once it has finished
//it’s little hello
delay(timeAfterAction);
}
//end of robot action
}
}

The other cool thing that has happened recently is I have received on loan for a year a Macbook Air from my school for learning iOS development. Aside from all the pretty Mac graphics and hardware design I think one of the main cool things about this computer is it’s flash hard drive. This means it’s boots up REALLY fast making it a much more useful device than my slower booting (but to be fair, faster overall Dell). Also it’s weight and size is quite impressive. I’m going to be pretty tempted to buy it from the school at the end of the year.

I was also asked by my iOS dev teacher to share my thoughts on objective-c. Well seeing as I really haven’t done that much in it already I thought I’d just make a meme about it instead.

A cool little robot I’m working on

So after getting back from my holiday I was bored for a bit. Then I came up with a cool idea. How awesome would it be to have a robot that sits in my school locker greeting me whenever I open it. Like a little animal that hides out in there. So a small holiday project was born. It consists of a servo, speaker, led, light sensor, rechargeable AAA batteries,a little cheap telescope, blu tac and an arduino clone board designed by me to control the whole thing.

The robot looks like this at the moment. Please excuse the low res of the iPad’s camera. It was all I had with me.

20120208-181611.jpg

The eye part of the robot is constructed out of a plastic lens and an LED for lighting it up. It sits on a servo providing robotic movement.

20120208-181611.jpg

The whole project is controlled by a simple arduino clone I made. It’s basically just the atmega328 processor, programming pinout, crystal and caps, reset resistor and an LED connected to digital pin 13 to determine whether a problem is caused by the processor or other electronics.

20120208-181946.jpg

So the robot head at the moment is pretty much just a servo with a little telescope for an eye and an LED to light up the “eye”. The program for it at the moment is pretty simple. It basically just checks whether the door is open with a light sensor reading, then when it detects an open door it does some beeping, head shaking and eye blinking. When I get some free time (stupid school) I’ll make a better program for it that makes it happy, sad or excited and plays a little tune etc making it more realistic. Then I’ll give you some more details.

I’m beginning to learn iOS development through school at the moment. It’s going to be an awesome year. There’s lots of other cool stuff happening as well.

Just thought I’d keep you posted.