프로젝트 명 : 공용화장실 사용자표시 및 환풍기 시스템
본 자료는 5페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
해당 자료는 5페이지 까지만 미리보기를 제공합니다.
5페이지 이후부터 다운로드 후 확인할 수 있습니다.

목차

1. 프로젝트 정의
2. 프로젝트 요구사항 분석
3. 초기 설계(S/W)
4. 상세 설계(S/W)
메트릭스 LED 구동 방법
DC 모터 동작
E-Board DC Motor와 8255의 포트C
누름 스위치 동작 설명
누름스위치의 입력 회로
5. 최종결과 및 고찰
최종 source (남+여 표시)

본문내용

의 소스 결합 하지 못함.
팀원들 간의 단합은 잘되었으나 C언어에 대한 지식이 부족하여 많은 어려움을 겪었다. 교수님과 주변 도움에도 불구하고 이번 프로젝트를 성공 해내지 못한 것이 아쉽다. 그래도 이번 프로젝트를 진행하면서 EZ보드에 있는 Dot matrix 와 DC Motor 에 관한 기본적인 원리를 이해하는데 많은 도움을 받을 수 있었다. 처음 작성한 순서도의 내용대로 차근차근 진행해 나갔어야 하는데 처음 과정을 생략하고 중간 과정부터 프로젝트를 진행해나가 중간에 막혀 만족하지 못한 결과물이 나온 것 같다.
최종 source (남+여 표시)
#include
#include
#include
#include "eblib.h"
#define BASE_ADDR 0x300
#define PORTA BASE_ADDR | 0x04
#define PORTB BASE_ADDR | 0x05
#define PORTC BASE_ADDR | 0x06
#define CWR0 BASE_ADDR | 0x07
#define CWR1 BASE_ADDR | 0x0b
#define DC_MOTOR_ON 0x08
#define DC_MOTOR_OFF 0x00
#define switch_on 500
#define switch_off 500
#define On_Time 100
#ifndef TRUE
#define TRUE 1
#endif /* ifndef TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* ifndef FALSE */
void init_eboard(void)
{
outportb(CWR0, 0x88); /* PortA, PortB, PortC(L):Out, PortC(H): In */
outportb(CWR1, 0x80); /* PortA, PortB, PortC(L):Out, PortC(H): Out */
outportb(PORTA, 0xff); /* initialize dot_matrix led */
}
int EbdSwitch(int SwitchId)
{
unsigned int nDin, bOn;
nDin = inp(PORTC); /* read switch port */
switch (SwitchId)
{
case 0: bOn = (nDin & 0x10) ? FALSE : TRUE; break;
case 1: bOn = (nDin & 0x20) ? FALSE : TRUE; break;
case 2: bOn = (nDin & 0x40) ? FALSE : TRUE; break;
case 3: bOn = (nDin & 0x80) ? FALSE : TRUE; break;
}
return bOn;
}
int main(void)
{
if(InitDriver(EB_DEVICE_PCI))
{
printf("Device Driver Loading Fail!\r\n");
return 0;
}
int i, j, count, timeout;
//clrscr();
init_eboard();
printf("\nPush a Button Switch (SW1, SW2, SW3, SW4).\n");
while(1)
{
for (i = 0; i < 4; i++)
if (!EbdSwitch(i)) continue;
count = 0;
for (timeout = 0; timeout < 50; timeout++)
{
if (EbdSwitch(i)) count++;
delay(1);
}
if (count < 10) continue;
//outp(PORTB, (1 << i) | (1 << (i+4)));
///* outp(RELAY, 1 << (i+4)); */
//printf("Push Button %d is pressed.\n", i);
if(i==0)
{
//init_eboard();
int ch1[8][8]={0,0,0,1,1,0,0,0,
0,0,1,1,1,1,0,0,
0,1,0,1,1,0,1,0,
1,0,0,1,1,0,0,1,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
1,0,0,0,0,0,0,1,
0,1,1,1,1,1,1,0};
int k=0;
while(k<100)
{
for (j = 0; j < On_Time; j++)
{ for (j = 0; j < 8; j++)
{ for (i = 0; i < 8; i++)
{
if(ch1[j][i] == 1)
{ outportb(PORTA, j*8+i);
delay(0);
}
else
{ outp(PORTA, 0xc0);
delay(0);
}
/* if (kbhit())
{init_eboard();
return;
}*/
}
}
printf("%d",i);
break;
}
k++;
}
init_eboard();
}
if(i==1)
{
init_eboard();
int ch1[8][8]={0,1,1,1,1,1,1,0,
1,0,0,0,0,0,0,1,
0,1,1,1,1,1,1,0,
0,0,0,1,1,0,0,0,
1,1,1,1,1,1,1,1,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0};
int k=0;
while(k<100)
{
for (j = 0; j < On_Time; j++)
{ for (j = 0; j < 8; j++)
{ for (i = 0; i < 8; i++)
{
if(ch1[j][i] == 1)
{ outportb(PORTA, j*8+i);
delay(0);
}
else
{ outp(PORTA, 0xc0);
delay(0);
}
/*if (kbhit())
{init_eboard();
return;
}*/
}
}
printf("%d",i);
break;
}
k++;
}
init_eboard();
}
count = 0;
do
{
if (!EbdSwitch(i)) count++;
delay(1);
}
while(count < 10);
outp(PORTB, 0x00);
/* outp(RELAY, 0x00); */
}
if (kbhit()) { if (getch() == 27) return; }
}
}
  • 가격2,000
  • 페이지수16페이지
  • 등록일2011.08.10
  • 저작시기2011.8
  • 파일형식한글(hwp)
  • 자료번호#694335
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니