Skip to content
Snippets Groups Projects
Commit cc1d56f8 authored by Arno Alexander's avatar Arno Alexander :alien:
Browse files

7 segment & lcd setup

parents
No related merge requests found
#include <LiquidCrystal.h>
//LCD
LiquidCrystal lcd(0, 1, 8, 9, 10, 11); /// REGISTER SELECT PIN,ENABLE PIN,D4 PIN,D5 PIN, D6 PIN, D7 PIN
//SEVEN SEGMENT
const int latchPin = 2; //to IC pin 12
const int dataPin = 3; //to IC pin 14
const int clockPin = 4; //to IC pin 11
const byte digit[] = {64, 121, 36, 48, 25, 18, 2, 120, 0, 16};
byte magnitude;
void setup() {
//SEVEN SEGMENT
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
magnitude = 0;
//LCD
lcd.begin(16, 2);
}
void loop() {
//SEVEN SEGMENT
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, digit[magnitude]);
digitalWrite(latchPin, HIGH);
magnitude = (magnitude+1)%10;
delay(250);
//LCD
lcd.print(" circuit digest");//print name
lcd.setCursor(0, 1); // set the cursor to column 0, line 2
lcd.print("ic tronic");//print name
delay(250);//delay of 0.75sec
lcd.scrollDisplayLeft();//shifting data on LCD
lcd.setCursor(0, 0);// set the cursor to column 0, line1
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment