Skip to content

Instantly share code, notes, and snippets.

#include <avr/io.h>
int main()
{
DDRC = 0xff; // Configure PORTC as output to connect Leds
DDRA = 0x00; // Configure PORTA as INput to connect switches
PORTA = 0xff; // Enable The PullUps of PORTA.
while(1)
{
PORTC = PINA; // Read the switch status and display it on Leds
#include <avr/io.h>
#include <util/delay.h>
int main()
{
DDRC = 0xff; // Configure PORTC as output
while(1)
{
PORTC = 0xff; // Turn ON the Buzzer conneted to PORTC
#include <avr/io.h>
#include <util/delay.h>
int main()
{
char count = 0;
DDRC = 0xff; // Configure PORTC as output
while(1)
{
#include <avr/io.h>
#include <util/delay.h>
int main()
{
char count = 1;
DDRC = 0xff; // Configure PORTC as output
while(1)
{
#include <avr/io.h>
#include <util/delay.h>
int main()
{
DDRC = 0xff; // Configure PORTC as output
while(1)
{
PORTC = 0xff; // Turn ON all the Leds connected to PORTC
#include <avr/io.h>
int main()
{
DDRC = 0xff; // Configure PORTC as output to connect Buzzer
DDRA = 0x00; // Configure PORTA as Input to read the switchs
PORTA = 0xff; // Enable The PullUps of PORTA.
while(1)
{
PORTC = PINA; // Read the switch status and Turn ON/OFF the Buzzer
#include "LPC17xx.h"
#include "rtc.h"
#include "lcd.h"
int main()
{
rtc_t rtc;
#include <lpc17xx.h>
void delay(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
{
for(j=0;j<5000;j++);
}
}