LCD
As my project has the LCD and the LED components so i start to think to control those two components through the Bluetooth module in week 8, to be ready for this in my project
LED
software : Tinker cad to simulate the circuit online, and a little bit with Fritzing
materials: Arduino uno , LED, LCD, wires, resistors,
mobile phone, breadboard.
successful trail with Android GUI
I started by watching the videos of the exercises for week 8, and practice it, here some of what i did, I started by simulate the circuit on tinker cad and write the code with the instructor on the Arduino software then try it with the real components
faild trail with the PC GUI
A trail for LCD code without any other component:
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(3,0);
lcd.print("Hello, world!");
lcd.setCursor(2,1);
lcd.print("Ywrobot Arduino!");
lcd.setCursor(0,2);
lcd.print("Arduino LCM IIC 2004");
lcd.setCursor(2,3);
lcd.print("Power By Ec-yuan!");
}
void loop()
{
}
The components that i used in my circuit, and the 5v adapter
i couldn't find the hc_05 component on fritzing, so i searched on youtube till i found this video
I download it from this link
then i searched for how to wire the lcd
and searching for how to simulate the circuit on youtube, and how to simulate the lcd on fritzing as wiring the lcd on real is different from the software
I started by searching for how to use the lcd and how to write the code on the Arduino, i found this links that helped me
then connecting each part alone , so first the the LCD to check if its working or not
then checking the Bluetooth module
Title of Media
some links helped me:
https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
https://www.arduino.cc/en/Tutorial/LibraryExamples/HelloWorld
then the checking the led
The circuit
then write the code of the led
Then adding the library of the LCD as shown in the video
then adding the the code of the Bluetooth module to the circuit
here i found a challenge with the lcd, there is no word appear on the lcd
i searched for the reason, till i found i could adjust the lcd with screwdriver in this white whole
And finally its done
the outcome of the lcd
The code that I used
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define led1 2
#define buzzer 7
char incomingdata = 0;
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
Serial.begin(9600);
pinMode(2, OUTPUT);
pinMode(7, OUTPUT);
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(3,0);
lcd.print("Hello, world!");
}
void loop()
{ while (Serial.available()>0)
incomingdata = Serial.read();
if (incomingdata == '1') {
digitalWrite(led1, HIGH);
lcd.clear();
lcd.print("drink");
delay(500);
digitalWrite(buzzer, HIGH);
delay(1000);
}
else if (incomingdata == '2')
{ digitalWrite(led1, LOW);
lcd.clear();
lcd.print("water");
delay(500);
digitalWrite(buzzer, LOW);
delay(1000);
}
else if (incomingdata == '3') {
digitalWrite(led1, HIGH);
lcd.clear();
lcd.print("everyday");
delay(500);
digitalWrite(buzzer, HIGH);
delay(1000);
} else {
digitalWrite(led1, LOW);
} }
menna elbadry _instractur_
I faced lots of challenges through trying to pair the Bluetooth with the mobile phone
Title of Media
As i will use the led and the LCD in my projects but without using the Bluetooth module by using the push button,
so this a great trial for my to do this before starting next week
Title of Media
Title of Media