Friday, 13 October 2017

AUTOMATED LOCKING SYSTEM

GROUP MEMBERS

ASYRAFULLAH BIN ATIKULLAH (01DIP15F1053)
MUHD FIQRI BIN MOHD AZMAN (01DIP15F1069)
AMIRUL AZHAR BIN MOHD HANAPI (01DIP15F1044)

SYNOPSIS

Pengisar telur merupakan satu alat yang akan mengisar telur mengikut kelajuan yang ditetapkan sendiri oleh pengguna. Contohnya, pengguna boleh menetapkan kelajuan sama ada perlahan,sederhana atau laju.

LIST OF HARDWARE AND SOFTWARE

HARDWARE :


  1. DC Motor
  2. Project Board
  3. PIC16F877A
  4. Motor Driver L293D
  5. Jumper Wire
  6. SK40C Board
  7. Programmer

SOFTWARE :

  1. MPLAP IDE (32 bit)
  2. Proteus 8 Professional
CODING

#include<htc.h>
void delay(unsigned long);
void forward(void);
void reverse(void); void stop(void);

  CONFIG (0x3F3A);

#define sw1      RB0
#define sw2      RB1
#define MOTOR_2  RB4
#define MOTOR_1  RB5
#define PWM      RC2

//--------------   WRITE YOUR PROGRAM HERE   ----------------------------



void main()
{





while(1)
{




TRISB=0b00000011; PORTB=0b00000000;

TRISC=0b00000000; PORTC=0b00000000;



if(sw1==0&&sw2==1)         //press sw1, move clockwise
{
forward();
}

if(sw1==1&&sw2==0)         //press sw2, move counter clockwise
{
reverse();
}


else
{
stop();                           //stop the motor
}
}
}

void forward(void)
{
MOTOR_1=0; MOTOR_2=1; PWM=1;
}




void reverse(void)
{
MOTOR_1=1; MOTOR_2=0; PWM=1;
}

void stop(void)
{
MOTOR_1=0; MOTOR_2=0; PWM=0;
}

void delay(unsigned long)
{
unsigned char i;
for (i=0xDE;i!=0;i--)
{


Lecturer Signature : Name:
Date: Time:
unsigned char j;
for (j=0x50;j!=0;j--)
{
unsigned char k;
for (k=0xC;k!=0;k--)
{
}
}
}
}

VIDEO

No comments:

Post a Comment