Embedded programming

Assignment: read a microcontroller data sheet

program your board to do something, in as many different programming languages as possible

For this assignment, I

[Designing a board with Eagle]

I added one LED and one button with registers on the schematics
and moved to the board view on eagle.
When I did "route" to connect paths on the board,
sometimes small pieces of red chuncks left on the board.
DRC pointed out these errors and I had to reroute paths.
I exported png files of the top and the dimension of the board and
was ready to mill the board.
I started milling with the default setting, however the depth of 
Z was not enough. I tweaked it and found that
-0.1 too shallow
-0.15 OK
-0.2 too deep.
For cutting out, png file from dimension did not work.
Then, decided to use rectangle drawn on GIMP.

[stuffing]

The orientation of LED made us confused, but after we figured out that
the green line showed minus, others went smoothly.

[Programming]

First, I tried "blink" in the example of Arduino.
It showed initialization error rc=-1.
I was not sure what was the reason of error.
Wrong direction of cable? Wrong arduino pin set?(pin# should be followed by # of PA, not
# of pin) Bad soldering?
Checking the board with a multi-meter showed bad connections on my board.
After fixing it, I also tried examples of button and blinkwithoutdelay.
Next, C. 
When I tried to test "hello.ftdi.44.echo.c" and "hello.ftdi.44.interrupt.c".
all commands of "make" went well, but when I tried to test on the terminal,
I could not get any response.
Bad connection again!
I resoldered and fixed them and finally it went well.
We had a lecture about how to program for LED and button from David.
David's online tutorial was also helpful.
Link:AVR Programming Tutorial
========================================================
//LED blink
#include "avr/io.h"
#include "util/delay.h"
int main(){
DDRA=_BV(PA7); //128 deximal
while(1){
PORTA=_BV(PA7);//LED ON
_delay_ms(500);
PORTA=0;
_delay_ms(500);//LED OFF
}
}
--------------------------------------------------------
//button for LED
#include "avr/io.h"
#include "util/delay.h"

int main(){
DDRA=_BV(PA7); //128 deximal //LED
while(1){
if(PINA & _BV(PA3)){//button high
PORTA=0; }else
{//button low
PORTA=_BV(PA7);
}
}
}
-------------------------------------------------
For button press, make file should have this line
program-usbtiny-fuses: $(PROJECT).hex
avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0xFE:m
========================================================

Tapping game

I decided to make a game to test human time-interval perception in Arduino and C.
In this program, LED starts blinking with 50ms intervals.
If we can push buttons precisely with intervals shown with LED (smaller error than 10% of interval),
 intervals will be longer by 50ms and the level of game will increase.  

Arduino file
C file/C MAKE file