Posts Tagged ‘Shift Register’

Punch Acceleration Sensor – Part 3

April 6, 2010

In this part I will describe the software side of the project. You can download the code here. I would highly recommend that you download ATMega328P documentation as well for register descriptions, notes and sample code.

Beginner Arduino Notes.

Any Arduino based program has at least 2 entry points:

void setup()
{
}
void loop()
{
}

Code within setup() is executed only once at the start and code within loop() is executed multiple times. You will also notice syntax like this:

ISR (TIMER1_OVF_vect) 
{
}

This is an interrupt handling routine for the Timer1 overflow interrupt. Just writing this code however is not enough as you need to enable that interrupt. Some of the interrupts are already handled by Arduino Wire library (such as Timer0 overflow) so they are not available to user code without additional steps.

There are several ways to do i/o operations. Arduino provides friendly pinMode(), digitalWrite(), digitalRead() functions but you can use native AVR way of reading/writing to various microcontroller registers.

(more…)

Advertisements

Punch Acceleration Sensor – Part 2

April 4, 2010

In this part I will describe the hardware side of the Punch Acceleration Sensor and the next part will be about the software.

You can download Eagle schematics and printouts here

Here’s the basic hardware schematic (click for pdf version):

Punch Acceleration Sensor – Schematics

These schematics use SparkFun Eagle Library for the Arduino board so the pins shown are for the Arduino board and not ATmega328. You can see how those pins correspond to ATmega328 pins by downloading schematics from Arduino Duemilanove specs page.

(more…)