nice to meet you...

I like a heap of things. Writing. Thinking. Photography. Film-making. Conspiring. Aspiring. Dreaming. Reading. Watching. Listening. Electronics.

Tuesday, October 2, 2012

Arduino & Processing get together!

Ok, so this is my first "electronics" post, if you know me personally you won't be surprised to that I'm a geek! And proud of it too :)

Anyway so I scoured the Internet for tutorials on how to do this and I found heaps but they done ages ago. Which meant that since Arduino updated the programming software some of the 'code' was redundant. Furthermore I had scour even more to figure out what had changed and how to change it!

I don't have any programming training, everything I know was either found on Google.co.nz; arduino.cc; processing.org; and this PDF http://tinyurl.com/ArduinoProcessingWorkshopPDF.


In that picture is everything working fine, but how did I get there?

Well I used the schematic for the potentiometer setup from here, I did use the arduino.cc sites one but the readings were all over the place and sporadic. So my guess is that the 'tie-down resistor' helps to stabilise things.

here is the pic from that site:
I only did the potentiometer part, not the black and red wires that run up the side of the breadboard.

What you will need:

  • Arduino
  • Breadboard
  • Potentiometer/ variable resistor
  • 1K resistor
  • Arduino and Processing programs on your computer


So once you are all setup and wired up you want to upload your 'code' to the Arduino. This is the code I'm using:

Arduino:


int sensorValue = 0;
int sensorPin = A0; // this is the pin to which we
// connect the potentiometer
void setup() {
Serial. begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPin)/4; // the potentiometer’s range is from
// 0-1023 but we only need numbers from
// 0-255.

Serial.write(byte(sensorValue));
delay (100);
}


The bit I highlighted in yellow is what has changed from old code that is floating around on the web. They basically just reformatted it. Yep.

Now onto Processing...

I suggest you have a play around on Processing before doing this tutorial. But you can just do this as well, no one is stopping you. I'm still trying to get my head around the important parts of a program and the parts that are changeable so that instead of drawing lines (as we will be doing here) I can make each line 'represent' an Image and have an interactive slideshow happening... but I digress...

The processing code:


import processing.serial.*;
Serial port;
int sensorValue;
void setup() {
size(1000, 500);
//noStroke();
frameRate(10);
println(Serial.list());
port = new Serial(this, Serial.list()[0], 9600);
// choose the port that the Arduino is
// connected to, on a Macintosh choose
// the tty.usbserial port
}
void draw() {
if (0 < port.available()) {
sensorValue = port.read();
}
background(204);
for (int i = 0; i < sensorValue+1; i++) {
// this is the “for” loop, see pp.61
// in the book “Processing” by Reas and Fry
stroke(255-i, 0, i); // choose the color of the line based on the
// potentiometer’s sensorValueue
line (i*5, 100, (i*5)+10, 400); // draw the lines based on the
// potentiometer’s sensorValueue
}
println(sensorValue); // prints out sensorValueues from Arduino board in
// the console, just to see what Processing
// actually receives from the Arduino board
}

I'm not at the stage yet where I can explain to you what every bit of code means and why it is there, but I will get there someday soon! :D

If everything is connected properly you should be able to turn your potentiometer and a gradient of vertical lines from red to purple should move across your screen.

That's it I think!

Grace and Peace,
Andy

p.s. please comment if you have any questions or ideas!

p.p.s. also comment if you want to collaborate on Arduino/ processing related stuff, the possibilities are endless!

Monday, October 1, 2012

Helping Little Mircales Survive!

My amazing wife has just started this fundraising campaign.

You can read a bit about what she went through as child on here profile which is linked on the fundraising page.



Children are really precious, lets get behind Rita and help her help this very special and beautiful family.

Grace and Peace,
Andy

One of my first Go Pro clips :D

Been enjoying using the Go Pro I bought a month ago. This is one of the videos I have made so far.

I'm really keen to start skating again and just mucking around different angles and shots with the Go Pro, maybe even get to know some local skaters in the neighbourhood my wife and I just moved to; Massey, Waitakere City (West Auckland).

If you have any ideas for film or photography drop a comment here I'd be keen to collaborate!

Grace and Peace,
Andy

Sunday, September 30, 2012

The Freedom of Self-Forgetfulness (A Book Reflection)

The Freedom of Self-Forgetfulness by Timoty Keller is an explosive little book. A friend suggested it here first. He expounded on the contents of the book a lot better than I can (so click that link and have a read). I read it this morning (about 8 hours before writing this post).



The line that is replaying itself in my head is: "... the essence of gospel-humility is not thinking more of myself or less of myself, it is thinking of myself less..." (32). This Keller goes onto say is, "blessed self-forgetfulness".

I will be contemplating this for a while yet!

I really suggest you get your hands on this book, especially if low/high self esteem is something you struggle or are aware of in your own life.

Grace and Peace,
Andy

(p.s. a place where you can get a copy: http://www.bookdepository.co.uk/Freedom-Self-Forgetfulness-Timothy-Keller/9781906173418)



Wednesday, September 26, 2012

Party Poppers!

Party Poppin' .gif...

Enjoying photography.

 I recently got a Go Pro HD Hero 2 (what a mouthful!) and have absolutely enjoyed shooting with it!

<= The pic on the left here is of my friend Ira he plays the accordion.

The above is me halfway through a layup. Haven't tried this type of shot before, so I'm actually buzzing at the moment at the potential of this wee gadget. This is a heavily edited shot. Took me about 30 minutes to do this, so it's not just point and shoot, but there is still room for improvement when it comes to these types of shots.

As a result I'm going to start skating again, ready to start pushing and experimenting with my Go Pro... stay tuned.

Grace and Peace.

What a year!

As I write, it's 3 days till I have been married for 3 months to my beautiful wife, Mrs. Rita Lee Crowe and 7 weeks exactly till the end of my year as a Training Teacher!

I know I haven't even mentioned Teaching on here before. This year has been so epic, getting married and studying, that I just haven't had time to write!

Here are some wedding photos!












Best day of my life, and I have had many more since then! :D

Grace and Peace.