Learning the basics

Part of the reason I wanted to take on the SeeStar project was to learn more about electronics. I write software and program computers every day, but building custom hardware and electronics is something I do not have much experience with.

This weekend I’ve spent some time learning more about the basics of electronics. The SparkFun web site has a wealth of fantastic learning reasones. Some of the articles and tutorials I’ve work through over the weekend are:

I also spent some time installing the Arduino software and getting it connected to old Arduino Duemilanove. I bought the Arduino and some components back in 2009, but haven’t really done much with them, so it was fun to try out some of the concepts from the SparkFun tutorials.

The SeeStar uses an Arduino Pro Mini, a much smaller version than the Duemilanove, but the same principles apply. The SeeStar software is already written, but understanding how the different parts work will make it easier to test each component in isolation when I start putting together the camera.

The little circuit on the picture is turning the LED connected to the Arduino on or off. The source code is included below.

Right now I’m waiting for break away headers for the Arduino Mini Pro. Once I get them I need to do some soldering, so the next SparkFun tutorial I plan to go through is on how to do through-hole soldering.

#define LED 13    // LED connected to digitial pin 13
#define BUTTON 7  // input pin for push button

int val = 0;
int old_val = 0;
int state = 0;

void setup() {
  pinMode(LED, OUTPUT);   // LED is output
  pinMode(BUTTON, INPUT); // button is input
}

void loop() {
  val = digitalRead(BUTTON);

  if (val == HIGH && old_val == LOW) {
    state = 1 - state;
    delay(10);
  }

  old_val = val;

  if (state == 1) {
    digitalWrite(LED, HIGH);  // turns on LED
  } else {
    digitalWrite(LED, LOW);   // turns off LED  
  }
}

Jonas Follesø

Programmer, Triathlete, Traveler, Under Water Enthusiast and GoPro Videographer from Trondheim, Norway. Works as Chief Scientist and Manager at Bekk Consulting AS.

Trondheim, Norway http://jonas.follesoe.no