Notes
Notes - notes.io |
#include <util/delay.h>
#include <string.h>
#define LCD_PORT PORTB
#define LCD_DDR DDRB
#define RS 0
#define EN 1
#define DB4 4
#define DB5 5
#define DB6 6
#define DB7 7
int main(void)
{
LCD_DDR = (0xF0) | (_BV(RS)) | (_BV(EN));
_delay_ms(20);
LCD_Init();
LCD_String("Bartek Skorek");
LCD_Command(0xC0);
LCD_String("5.5/10");
while(1) {}
}
void LCD_Init()
{
LCD_Command(0x33);
LCD_Command(0x32); /* Send for 4 bit initialization of LCD */
LCD_Command(0x28); /* 2 line, 5*7 matrix in 4-bit mode */
LCD_Command(0x0c); /* Display on cursor off */
LCD_Command(0x06); /* Increment cursor (shift cursor to right) */
LCD_Command(0x01); /* Clear display screen */
}
void LCD_String (char *str) /* Send string to LCD function */
{
int i;
for(i=0;str[i]!=0;i++) /* Send each char of string till the NULL */
{
LCD_Char (str[i]);
}
}
void LCD_Command( unsigned char cmnd )
{
LCD_PORT = (LCD_PORT & 0x0F) | (cmnd & 0xF0);/* Sending upper nibble */
LCD_PORT &= ~ (1<<RS); /* RS=0, command reg. */
LCD_PORT |= (1<<EN); /* Enable pulse */
_delay_us(1);
LCD_PORT &= ~ (1<<EN);
_delay_us(200);
LCD_PORT = (LCD_PORT & 0x0F) | (cmnd << 4);/* Sending lower nibble */
LCD_PORT |= (1<<EN);
_delay_us(1);
LCD_PORT &= ~ (1<<EN);
_delay_ms(2);
}
void LCD_Char( unsigned char data )
{
LCD_PORT = (LCD_PORT & 0x0F) | (data & 0xF0);/* Sending upper nibble */
LCD_PORT |= (1<<RS); /* RS=1, data reg. */
LCD_PORT|= (1<<EN);
_delay_us(1);
LCD_PORT &= ~ (1<<EN);
_delay_us(200);
LCD_PORT = (LCD_PORT & 0x0F) | (data << 4); /* Sending lower nibble */
LCD_PORT |= (1<<EN);
_delay_us(1);
LCD_PORT &= ~ (1<<EN);
_delay_ms(2);
}
|
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