LED Blinking program by using Mikro (PIC 16F877)
void main() {
TRISB = 0; //Makes PORTB0 or RB0 Output Pin
while(1) //Infinite Loop
{
PORTB = 0x55; //LED ON
Delay_ms(1000); //1 Second Delay
PORTB = 0xAA; //LED OFF
Delay_ms(1000); //1 Second Delay
}
}
LED Blinking program by using Mikro (PIC 16F877)
void main() {
TRISB = 0; //Makes PORTB0 or RB0 Output Pin
while(1) //Infinite Loop
{
PORTB = 0x55; //LED ON
Delay_ms(1000); //1 Second Delay
PORTB = 0xAA; //LED OFF
Delay_ms(1000); //1 Second Delay
}
}
LED Blinking program by Using Atmega32 - Atmel Studio 6
#ifndef F_CPU // defining clock speed of the processor
#define F_CPU 16000000UL // 16 MHz clock speed
#endif
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC = 0xFF; //Nakes PORTC as Output
while(1) //infinite loop
{
PORTC = 0xFF; //Turns ON All LEDs
_delay_ms(30); //1 second delay
PORTC= 0x00; //Turns OFF All LEDs
_delay_ms(30); //1 second delay
}
}
LED Blinking By using 8051 in Keil IDE
LED Blinking using PIC 16f877a
LED Blinking program by Using Atmega32 - Atmel Studio 6
#ifndef F_CPU // defining clock speed of the processor
#define F_CPU 16000000UL // 16 MHz clock speed
#endif
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC = 0xFF; //Nakes PORTC as Output
while(1) //infinite loop
{
PORTC = 0xFF; //Turns ON All LEDs
_delay_ms(30); //1 second delay
PORTC= 0x00; //Turns OFF All LEDs
_delay_ms(30); //1 second delay
}
}
LED Blinking By using 8051 in Keil IDE
LED Blinking using PIC 16f877a
compiler - sdcc ,XC8.
#define _XTAL_FREQ 8000000 // setting the crystal frequency
#include <xc.h> // Header file inclusion ,to add function like _delay_ms()
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config CP = OFF // FLASH Program Memory Code Protection bits (Code protection off)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON // Low Voltage In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EE Memory Code Protection (Code Protection off)
#pragma config WRT = ON // FLASH Program Memory Write Enable (Unprotected program memory may be written to by EECON control)
int main()
{
TRISB0 = 0; //RB0 as Output PIN
while(1) // endless loop
{
RB0 = 1; // LED ON
__delay_ms(1000); // 1 Second Delay
RB0 = 0; // LED OFF
__delay_ms(1000); // 1 Second Delay
}
return 0;
}
LED Blinking By using 8051 in Keil IDE
/led-blinking-program-by-using-atmega32
compiler - sdcc ,XC8.
#define _XTAL_FREQ 8000000 // setting the crystal frequency
#include <xc.h> // Header file inclusion ,to add function like _delay_ms()
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config CP = OFF // FLASH Program Memory Code Protection bits (Code protection off)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = ON // Low Voltage In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF // Data EE Memory Code Protection (Code Protection off)
#pragma config WRT = ON // FLASH Program Memory Write Enable (Unprotected program memory may be written to by EECON control)
int main()
{
TRISB0 = 0; //RB0 as Output PIN
while(1) // endless loop
{
RB0 = 1; // LED ON
__delay_ms(1000); // 1 Second Delay
RB0 = 0; // LED OFF
__delay_ms(1000); // 1 Second Delay
}
return 0;
}
LED Blinking By using 8051 in Keil IDE
/led-blinking-program-by-using-atmega32
sbit LED1 = P2^0; // P2.0 of the pin name cahnged to LED1
void delay(); // a delayis used to give some delay in between turn ON and OFF
void main()
{
while(1)
{
LED1 = 0;
delay();
LED1 = 1 ;
delay();
}
}
void delay()
{
int j;
for(j=0; j<500; j++)
;
}
sbit LED1 = P2^0; // P2.0 of the pin name cahnged to LED1
void delay(); // a delayis used to give some delay in between turn ON and OFF
void main()
{
while(1)
{
LED1 = 0;
delay();
LED1 = 1 ;
delay();
}
}
void delay()
{
int j;
for(j=0; j<500; j++)
;
}
16x2 LCD Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...