NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Experiment 7

part1:Liquid Crystal Display
-------
ISIS:
LCD pins:
pin4 with 21 in pic
pin5 with 20 in pic
pin6 with 19 in pic
pin11 with 27 in pic
pin12 with 28 in pic
pin13 with 29 in pic
pin14 with 30 in pic

------
code:
#include "ee470.h"
void main(void)
{
char name[]="JUST ";
char xline[17];
float t;
unsigned char k, j;
OSCCON=0x73;
ADCON1=0xF;
lcd_init();
gotoxy(0,14); putch_lcd('A');
gotoxy(1,6); putline_lcd("EE445");
gotoxy(0,0); putline_lcd("Welcome to");
gotoxy(1,12); putch_lcd('B');
gotoxy(1,0); putline_lcd(name);
Delay10KTCYx(200);
k=40; t=-3.2197;
sprintf(xline,"k=%x, t=%g",k,t);
gotoxy(1,0); putline_lcd(xline);
while(1);
}
#############
part2:7.3 Detect Day/Night
using LDR
-------
ISIS:
LCD pins:
pin4 with 21 in pic
pin5 with 20 in pic
pin6 with 19 in pic
pin11 with 27 in pic
pin12 with 28 in pic
pin13 with 29 in pic
pin14 with 30 in pic

pic pin10:led to res=330 to gnd
pic pin40:switch to VCC to 10k to gnd

---------
code:
#include <p18F4520.h>
#pragma config OSC=INTIO67,WDT=OFF,MCLRE=OFF
#define LED PORTEbits.RE2
#define LDR PORTBbits.RB7
void main()
{
ADCON1=0xF;
OSCCON=0x73;
TRISB7=1;
TRISE2=0;
while(1)
{
LED=LDR;
}
}
############
part3:Keypad Interfacing 4
Rows by 3 Columns
-----
ISIS:
KEYpad pins:
pinA to pic pin33
pinB to pic pin34
pinC to pic pin35
pinD to pic pin36
pin1 to pic pin37
pin2 to pic pin38
pin3 to pic pin39
pic pin 25 to V.terminal

------
code:
#include "ee470.h"
void RBIF_ISR1(void);
unsigned char keypad[4] [3] =
{{'1','2','3'},{'4','5','6'},{'7','8','9'},{'*','0','#'}};
void interrupt high_priority chk_isr(void)
{
if (INTCONbits.RBIF==1) {
temp=PORTB;
RBIF_ISR1();
}
}
void main()
{
ADCON1=0Xf;
OSCCON=0X70;
serial_init(51,1);
INTCON2bits.RBPU=0;
TRISB=0xF0;
PORTB=0xF0;
while(PORTB != 0xF0);
INTCONbits.RBIF=0;
INTCONbits.RBIE=1;
INTCONbits.GIE=1;
while(1);
}
void RBIF_ISR1(void)
{
unsigned char temp, col, row;
__delay_ms(15);
PORTB=0x0F;
for (row=0; row<4; row++)
{
bitclr(PORTB,row);
for (col=0; col<3; col++)
{
if (bittst(PORTB,col+4)==0)
{
putch(keypad[row][col]);
while(PORTB !=0xF0) PORTB=0xF0;
INTCONbits.RBIF=0;
return;
}
}
bitset(temp,row);
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.