Electronics Design

This week assignment was to program the board made in week 5. For this we were ask to try to program our board, using differnt laguages.

 

t

 

The first language that I used was arduino. And the code was on from their Library.


FabDuino Blinky from Guillermo Bernal on Vimeo.

After the success with arduino, I decided to give C a go and i use Neil's echo code

//
//
// hello.ftdi.44.echo.c
//
// 115200 baud FTDI character echo, with flash string
//
// set lfuse to 0x7E for 20 MHz xtal
//
// Neil Gershenfeld
// 12/8/10
//
// (c) Massachusetts Institute of Technology 2010
// Permission granted for experimental and personal use;
// license for commercial sale available from MIT.
//

#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include <stdio.h>

int main(){
double counter=0;
double prev=0;
double interval=5;
double diff;
DDRA=_BV(PA7); //128 deximal
while(1){
counter++;
//printf("%ld\n",counter);

//PORTA=_BV(PA7);

PORTA=_BV(PA7);
_delay_ms(interval/2.0);
PORTA=0;
_delay_ms(interval/2.0);


if(PINA & _BV(PA3)){ //high
PORTA=0;
}else
{//low:button on

diff=counter-prev-interval;

if(abs(diff)<0.1*interval){
interval=interval+5;
}
prev=counter;

//if(abs(counter-prev-interval)<diff){
//PORTA=_BV(PA7);
//}
}


}
}
// _delay_ms(500)

Then I got this Error.


>

Shotly after the error, someone stepped on my board. (It was not me.)


Since I found my self without a board, I decided to make an Arduino clone base on the FabKit example


AVR seems seems to see the board, but stills need more work