Vera Serial Interface For Arduino

Posted on

Creating an Arduino Bluetooth Serial Interface Bluetooth is the most popular way of connecting an Arduino to a smartphone wirelessly. In this tutorial, we will create an arduino-bluetooth interface and send messages from an arduino to smartphone and arduino to a personal computer. Learn using SPI in Arduino. SPI (Serial Peripheral Interface), establishes communication between multiple peripheral devices or microcontrollers.The SPI interface bus exchanges data between microcontrollers and small peripherals such as shift registers, sensors, and SD cards. MegunoLink Pro’s User Interface Panel was created to modify settings and control Arduino programs using serial commands. Most programs have a few settings that you’d like to change from time to time: a set-point temperature, the data transmission rate, or; the power for a radio transmitter, for example.

Step one is to download the Liquid Crystal library if you haven't done so already.

I will add a zip file with the library for Windows or you can go the site https://bitbucket.org/fmalpartida/new-liquidcrysta... and download it yourself.

Once you have the library, extract the contents in the Arduino library folder on your computer. On my computer the default location was C:programfilesArduinolibrary.

I attached a copy of the sketch I used in this instructable,

Here is the breakdown:

First you need to load the libraries, we will load wire.h, LCD.h and LiquidCrystal_I2C.h

//load libraries
#include wire.h

#include LCD.h

#include LiquidCrystal_I2C.h


Then we need to define variables... in this section just copy it as is because it tells the IDE where to find the PCF8574A and how to interact with the LCD to turn on the backlight, the read pin, the write pin and data pins etc...

//Define variables

Vera serial interface for arduino download

#define I2C_ADDR 0x27 //Define I2C Address where the PCF8574A is

Serial in arduino

Vera Serial Interface For Arduino Keyboard

#define BACKLIGHT_PIN 3

#define En_pin 2

#define Rw_pin 1

#define Rs_pin 0

#define D4_pin 4

#define D5_pin 5

#define D6_pin 6

#define D7_pin 7

Another line is needed to initialize the LCD, this is done through an array which includes the variables that we defined earlier.

//Initialise the LCD
LiquidCrystal_I2C lcd(I2C_ADDR, En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

In the void set up, we start by telling the IDE that we are dealing with a 16X2 LCD

lcd.begin (16,2);

Then I turn on the back light (always good to have a lit LCD), notice it is the same variable from above...

lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);

Then I tell it to go to the first line at left most position lcd.setCursor(0,0);

Vera Serial Interface For Arduino

and print lcd.print('I just made an');

then move the cursor to the second line and the left most position lcd.setCursor(0,1);

and print: lcd.print('Instructable :)');

There is void loop because the program need a loop to compile but it should remain empty.

And that's it.... very simple, if you follow these instructions the LCD will output anything you type in this code.

There is a detailed video in the next step.