Professional Documents
Culture Documents
Results and Discussions
Results and Discussions
AUTOMATION IN AGRICULTURE
TITLE : 8-bit LED MODULE
1. To insert the right code of LED pattern into the PICKIT2 program.
2. To identify each of the component on training kit and adapter.
3. To develop student's own LED pattern.
PROCEDURES
5. PIC connected to the training kit. Then training kit was switch on.
RESULTS AND DISCUSSIONS
PROGRAM 1:
#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5
void main()
{
Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;
Do
(
portb= 0b01010101;
delay_ms( 5000);
portb= 0b00110011;
delay_ms( 5000);
portb= 0b00100111;
delay_ms( 5000);
}while ( 1);
OUTPUT 1 :
Picture of patterns Descriptions
#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5
void main()
{
Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;
Do
(
portb= 0b01111110;
delay_ms( 7000);
portb= 0b11001111;
delay_ms( 6000);
}while ( 1);
OUTPUT 2 ( Exercise No 1) :
PROGRAM 3 (Exercise No. 3)
#include<16f877A.h>
#use delay(clock= 20000000 )
#fuses hs, noprotect, nowdt, nolvp
#byte PORTB=6
#byte PORTA=5
void main()
{
Set_tris_b( 0b00000000 ) ;
Set_tris_a( 0b00000000 ) ;
Do
(
portb= 0b100001;
delay_ms( 5000);
portb= 0b100010;
delay_ms( 2000);
portb= 0b001100;
delay_ms( 5000);
portb= 0b001010;
delay_ms( 2000);
}while ( 0);
As for the conclusion, student have successfully carried on the test based on the given
instruction in the lab manual. The LED on the training kit lights up according to their
subsequence because the inserted LED pattern were correct. Other than that, at the
same time, student easily handle the training kit. They had overlook the training kit
before using them for the experiment. Lastly, student have created the new pattern to
be try on the training kit.