Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

Saturday, March 13, 2010

March Madness Entry 13

Finally got an Arduino of my own, so I figured while I'm traveling I'll get a simple Arduino program up and running. No video or pictures as I'm in Philly. Simple, short script to get myself up to speed with the Arduino.

The formula I used to calculate the actual distance is linearizing the otherwise cubic return of a typical Sharp IR rangefinder - a popular, easy to use rangefinder that simply returns an analog voltage. This formula can be found in a datasheet provided by Sharp. It may require some minor adjustments for different Sharp sensors.

/*
Sample simple program by Keith Chester

Just print out the distance read from a SHARP IR Rangefinder.
*/

int IR_signal_pin = 1;

void setup(){
  Serial.begin(9600);
}

void loop(){
  int IR_raw_read = analogRead(IR_signal_pin);
  int actual_distance = (6787 / (IR_raw_read - 3)) - 4;
  Serial.println(actual_distance);
}

Saturday, March 6, 2010

Qik - FUBARlabs Arduino Course by Keith Chester



FUBAR Labs had its first Arduino class today - I had the day off so I popped in and offered help where I could. The class was a huge success! We're looking forward to doing it again and offering other, more advanced classes in the near future.