Description:
A free app for creating a simple Bluetooth oscilloscope with Arduino or ESP32. The app includes an example using an HC-05 module and Arduino, but it is also compatible with other modules. This simple oscilloscope can be used in various scenarios, such as automotive electronics for testing sensors, and in other applications where high-speed data isn't required. It can also serve as an educational tool for learning about signals.
Keywords:
Oscilloscope app, oscilloscope for Android, Arduino simulator, Arduino Bluetooth
Sample Code for Arduino and HC-05:
// Example for Arduino Nano with HC-05 module:
// Pinout:
// VCC --> Vin
// TXD --> pin 10
// RXD --> pin 11
// GND --> GND
#include "SoftwareSerial.h"
SoftwareSerial BTSerial(10, 11); // RX | TX
int val = 0; // Variable to store the read value
int analogPin = A7; // Potentiometer wiper (middle terminal) connected to analog pin A7
void setup() {
BTSerial.begin(9600); // HC-05 default baud rate in AT command mode
}
void loop() {
static unsigned long previousMillis = 0;
const unsigned long interval = 30; // Desired interval in milliseconds
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
// Read the analog value and send it over Bluetooth
val = analogRead(analogPin);
BTSerial.println(val);
}
// Add any non-blocking tasks here
// Avoid using delay() to maintain a responsive loop
}
Oxirgi yangilanish
29-mar, 2024