Ramesh
Published © GPL3+

Arduino Based Wireless Notice Board using Bluetooth

The project based on HC-05 Bluetooth module which Controlling 16x2 LCD SCROLLING display using android application.

IntermediateFull instructions provided18,091
Arduino Based Wireless Notice Board using Bluetooth

Things used in this project

Story

Read more

Schematics

android_lcd_tDgWrYjB7I.png

Code

HelloWorld.ino

Arduino
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("Hello world!");
  lcd.setCursor(0,1);
  lcd.print("Hello World");
  }


void loop()
{
}

Scroll_LCD.ino

Arduino
#include <LiquidCrystal_I2C.h>

// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;

// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);  

String messageStatic = "Dofbot.com";
String messageToScroll = "arduino, IoT, NODEMCU Projects done here";

// Function to scroll text
// The function acepts the following arguments:
// row: row number where the text will be displayed
// message: message to scroll
// delayTime: delay between each character shifting
// lcdColumns: number of columns of your LCD
void scrollText(int row, String message, int delayTime, int lcdColumns) {
  for (int i=0; i < lcdColumns; i++) {
    message = " " + message;  
  } 
  message = message + " "; 
  for (int pos = 0; pos < message.length(); pos++) {
    lcd.setCursor(0, row);
    lcd.print(message.substring(pos, pos + lcdColumns));
    delay(delayTime);
  }
}

void setup(){
  // initialize LCD
  lcd.init();
  // turn on LCD backlight                      
  lcd.backlight();
}

void loop(){
  // set cursor to first column, first row
  lcd.setCursor(0, 0);
  // print static message
  lcd.print(messageStatic);
  // print scrolling message
   lcd.setCursor(0,1);
  scrollText(1, messageToScroll, 250, lcdColumns);
}

Wireless_Notice_board.ino

Arduino
// Project by  G Ramesh
// dofbotindia@gmail.com
// dofbot.com

#include <Wire.h>

#include <LiquidCrystal_I2C.h>  
int lcdColumns = 16;
int lcdRows = 2;  
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows); 


char Display;
String Word;
String messageStatic;
String messageToScroll;


int L1;
int L2;

void scrollText(int row, String message, int delayTime, int lcdColumns) {
  for (int i=0; i < lcdColumns; i++) {
    message = " " + message;  
  } 
  message = message + " "; 
  for (int pos = 0; pos < message.length(); pos++) {
    lcd.setCursor(0, row);
    lcd.print(message.substring(pos, pos + lcdColumns));
    delay(delayTime);
  }
}

void setup()
{
  lcd.init();                      // initialize the lcd 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.begin(16,2);// Columnas y filas de LCD
  Serial.begin(9600);
}

void loop() {

  if(Serial.available())
  {
    Display = Serial.read();  
    Word = Word + Display; 

if (Display == '*') {

      Serial.println(Word);
      Serial.println();
      L1 = Word.indexOf(',');
      messageStatic = Word.substring(0, L1);
      L2 = Word.indexOf(',', L1+1);
      messageToScroll = Word.substring(L1+1, L2);

      Serial.print("messageStatic");
      Serial.println(messageStatic); 
      Serial.print("messageToScroll");
      Serial.println(messageToScroll);
      Word = "";
      lcd.setCursor(0,0);
      lcd.print(messageStatic);
       lcd.setCursor(0,1);
      lcd.print(messageStatic);
    //  lcd.setCursor(0,1);
    //  scrollText(1, messageToScroll, 250, lcdColumns);
        
  }
  
        }
}

Credits

Ramesh

Ramesh

15 projects • 18 followers

Comments