Académique Documents
Professionnel Documents
Culture Documents
Introduction
Component Circuit Block
Flow Char
Program Automatic gate consists of two basic components
used Diagram Diagram Result
Gate : the physical object that is moved to block the gate
opening
Gate operator : the machinery that moves the gates in and out
of the gate opening
5/12/2016
Start
Initialize
Atm eg a16A
Buzzer ON ,
Turn
Press push Yellow LED on,
on
button DING Motor start
device Initialize Motor
initialized
LCD output
WELCOME TO ~ MY
HOUSE DEAR~
System go to
initial state
1
1 3
Press
button
Press pus h button GON
DI NG
No
No Is the b utton
pressed ?
Yes
Is the DI NG ON ?
3 4
5/12/2016
Moto r sto p
5
spinning
af ter 500 ms
Press
button
GOF F Motor stop
spinning after
No 500 ms
Is the b utton
pressed ?
Yes
No
LCD disp la y
LOADING..
CLOSED
THE G ATE
End
/* { lcd_gotoxy(0,0); while(1)
* GATE_PROJECT.c DDRC = 0xFF; //Port C as lcd_puts(" WELCOME TO"); {
output lcd_gotoxy(0,1); if(PINA == 0xFE) //for ding INPUT
DDRA = 0x00; //Port A as lcd_puts("~MY HOUSE {
#include <avr/io.h> input DEAR~"); PORTC = 0x01; // FOR DING1
#define F_CPU PORTA = 0xFF; // Pull up _delay_ms(200); OUTPUT
lcd_clrscr(); lcd_clrscr();
8000000UL Port A lcd_gotoxy(0,0); lcd_gotoxy(0,0);
#include <util/delay.h> lcd_init(LCD_DISP_ON_CU lcd_puts("PRESS THE lcd_puts(" PLEASE WAIT ");
#include "lcd.h" RSOR); // initialize lcd BUTTON"); lcd_gotoxy(0,1);
lcd_clrscr(); lcd_gotoxy(0,1); lcd_puts("GATE WILL OPEN
lcd_gotoxy(0,0); lcd_puts("****************"); }
int main(void) _delay_ms(50); _delay_ms(10);
5/12/2016
Initial Push
Button 1
Condition (DING)
5/12/2016
Push Push
Button 2 Button 3
(GON) (GOFF)
Have the same results and prove the result when created an Automated
Gate System using C language and simulate the program using circuit