Giới thiệu sản phẩm
#include <SoftwareSerial.h>
SoftwareSerial bluetooth (0, 1);
const int LedPin = 13;
void setup() {
pinMode (LedPin, OUTPUT);
bluetooth.begin(9600);
Serial.begin(9600);
Serial.println("Bluetooth LED Control Ready");
// put your setup code here, to run once:
}
void loop() {
if (bluetooth.available()){// put your main code here, to run repeatedly:
char command = bluetooth.read();
if (command == '1') {
digitalWrite(LedPin, HIGH);
Serial.println("LED ON");
} else if (command == '0') {
digitalWrite(LedPin, LOW);
Serial.print("LED OFF");
}
}
}
------
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello!");
delay(5000);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
}
------
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// put your setup code here, to run once:
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello!");
delay(5000);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
}
Hình ảnh sản phẩm

Sản phẩm cùng tác giả
Sản phẩm liên quan
Không có sản phẩm nào
Đăng nhập để tham gia bình luận