Advertisement
Guest User

bt

a guest
Mar 11th, 2018
51
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <Wire.h>
  3. #include <SoftwareSerial.h>
  4. #include <LiquidCrystal_I2C.h>
  5.  
  6. LiquidCrystal_I2C lcd(0x3F, 20, 4);
  7. boolean BTconnected = false;
  8.  
  9. void setup()   {
  10.    Wire.begin(4,0);
  11.    pinMode(14, INPUT_PULLUP);
  12.   lcd.begin();
  13.   lcd.clear();
  14.   lcd.setCursor(4,0);
  15.   lcd.print("SETUP START");
  16.   delay(3000);
  17.   lcd.clear();
  18.   lcd.setCursor(0,0);
  19.   lcd.print(digitalRead(14));
  20.   lcd.print("Wait for BT...");
  21.       while (!BTconnected)
  22.     {
  23.       if ( digitalRead(14)==HIGH)  { BTconnected = true;};
  24.     }}
  25.     void loop(){
  26.         lcd.clear();
  27.       lcd.setCursor(3,3);
  28.       lcd.print("CONNECTED");
  29.     }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement