Heythi 40 Blinking LED

Heythi 40 Blinking LED - 5.0 out of 5 based on 1 vote
User Rating:  / 1
PoorBest 

Making a Blinking LED using Eclipse and WinAVR

In Eclipse Create a new project and a source file and make the settings.
Now write a code to blink an led.
Sample code 1:
#include <avr/io.h>
#include <util/delay.h>
int main()
{
    DDRD=255;
    while(1)
    {
    PORTD=0b11111111;
    _delay_ms(1000);
    PORTD=0b00000000;
    _delay_ms(1000);
    }
}

Sample code2 :
#include <avr/io.h>
#include <util/delay.h>
int main()
{
    DDRD=255;
    while(1)
    {
    PORTD=0b10101010;
    _delay_ms(1000);
    PORTD=0b00000000;
    _delay_ms(1000);
    }
}
transfer the code to heythi kit. Place the led pcb at portD as the ground  of led pcb connected to the ground with the portD in heythi kit and check the output.

Making a Blinking LED using Arduino-Compatible Software

Open Arduino.exe  and create a new file and change the board and programmer settings  and write the code in the new file.
Sample Code:

void setup() {                
    // initialize the digital pin as an output.
    DDRB =B11111111;   
}

// the loop routine runs over and over again forever:
void loop() {
 
    PORTB=B00001111;
    delay(100);
    PORTB=B11110000;
    delay(100);
}
Now Save it,compile it and upload it and check the output by placing the led pcb at portb output pins.

You are here: Home IT Services Uncategorised Heythi 40 Blinking LED