AVR microcontroller controlled relay

Publisher:不加糖的302Latest update time:2019-11-20 Source: 51heiKeywords:AVR Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include "macros.h"
#define uchar unsigned char
#define uint  unsigned int


void delay_ms(uchar i)
{
uchar a,b;
for(a=1;a   for(b=1;b<141;b++)
   {;}
}


void main(void)
{
DDRA=0X80;
PORTA=0X80;
DDRB=0XFF;
PORTB=0XFF;
DDRC=0X01;
PORTC=0X01;
DDRD=0X00;
PORTD=0XFF;


while(1)
  {
   PORTA  ^=  BIT(7);
    delay_ms(200);
delay_ms(200);
     delay_ms(200);
delay_ms(200);
  }
}

Keywords:AVR Reference address:AVR microcontroller controlled relay

Previous article:LCD12864 LCD display program
Next article:UART interface to control LED lights

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号