Assignment 8
embedded programming

in this assignment i tried to program my board with arduino and C, all files available here

first i tried neil's code, then i started learning more about the C programming language and make files, i followed many tutorials like those in tutorials in our archive and other online tutorials

i used gedit and AVR-GCC

after that i tried to compile & upload the code manually without make file using avrdude

to compile and upload the code i just type :

 sudo make -f .make 

the final try "also the easiest one" was using the arduino IDE

and here's the result :

adding attiny to arduino IDE

to add attiny to my arduino IDE i downloaded the attiny.zip file

then i ran the following commands "as i'm using linux"

 sudo cp attiny.zip /usr/share/arduino/hardware/
 cd /usr/share/arduino/hardware/ 
 sudo unzip attiny.zip
 sudo arduino

here's the arduino code

#include <SoftwareSerial.h>

SoftwareSerial mySerial(0,1);

int button = 3;
int led = 7;

void setup(){
  mySerial.begin(9600);
  pinMode(button,INPUT);
  pinMode(led,OUTPUT);
}

void loop(){
  if(digitalRead(button) == 0){
    digitalWrite(led,!digitalRead(led));
    mySerial.println("Hello World!!!");
    delay(1000);
  }
  else{
    digitalWrite(led,LOW);
  }
}