Μετάβαση στο κύριο περιεχόμενο

Αναρτήσεις

Προβολή αναρτήσεων από Μαΐου 14, 2025

Μέτρηση ταχύτητας ήχου με ESP32

  #include <LiquidCrystal_I2C.h> #include "BluetoothSerial.h" BluetoothSerial SerialBT; // 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 ( 0x 27 , lcdColumns, lcdRows ) ;   int trig = 5 ; int echo = 18 ; float sp; float lecture_echo; float ds; String output; void setup () {   SerialBT . begin ( "ESP32-Bluetooth20250402D" ) ; pinMode ( trig, OUTPUT ) ; digitalWrite ( trig, LOW ) ; pinMode ( echo, INPUT ) ; Serial . begin ( 115200 ) ; // initialize LCD   lcd . init () ;   // turn on LCD backlight                         lcd . backlight () ; } void loop () { if ( SerialBT . available ()) {   output= SerialBT . readString () ;  ds = output . toFloat () ;    // output = Serial.readString();  // Ser...