(Created page with "Category:Starter PIC16F877 =Code= <html> <script src="https://gist.github.com/sharanago/bf69e20dc277fda3f562779fbe2acbfe.js"></script> </html> =Demo= File:Pic16f877a r...")
 
Line 2: Line 2:
  
 
=Code=
 
=Code=
 +
 +
=LCD 1x16=
 +
<html>
 +
<script src="https://gist.github.com/sharanago/1c42e5b6253260bd8ead3d061d7a627a.js"></script>
 +
</html>
 +
 +
=LCD 2x16=
 
<html>
 
<html>
 
<script src="https://gist.github.com/sharanago/bf69e20dc277fda3f562779fbe2acbfe.js"></script>
 
<script src="https://gist.github.com/sharanago/bf69e20dc277fda3f562779fbe2acbfe.js"></script>
 +
</html>
 +
 +
=LCD 4x20=
 +
<html>
 +
<script src="https://gist.github.com/sharanago/5a15fb1ad85c3b91271ceaa453385410.js"></script>
 
</html>
 
</html>
  
 
=Demo=
 
=Demo=
 
[[File:Pic16f877a relay.gif]]<br><br>
 
[[File:Pic16f877a relay.gif]]<br><br>

Revision as of 15:57, 28 April 2016


Code

LCD 1x16

#include "lcd.h"
int main()
{
/*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTB.4 to PORTB.7*/
LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PB_4,PB_5,PB_6,PB_7);
LCD_Init(1,16);
LCD_DisplayString("Explore Lcd 1x16");
while(1);
return (0);
}

LCD 2x16

#include "lcd.h"
int main()
{
/*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTB.4 to PORTB.7*/
LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PB_4,PB_5,PB_6,PB_7);
LCD_Init(2,16);
LCD_DisplayString("Explore Embedded");
LCD_DisplayString("Lcd 4-bit Mode");
while(1);
return (0);
}

LCD 4x20

#include "lcd.h"
int main()
{
/*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTB.4 to PORTB.7*/
LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PB_4,PB_5,PB_6,PB_7);
LCD_Init(4,20);
LCD_DisplayString("Explore Embedded\n");
LCD_DisplayString("LCD 4-bit Mode\n");
LCD_DisplayString("20 x 4 \n");
LCD_DisplayString(":) :O");
while(1);
return (0);
}

Demo

Pic16f877a relay.gif