Exemplo de Plotter Bluetooth com ESP32 - Tutorial de Interface de Gráfico de Dados em Tempo Real

Visão Geral

O exemplo Bluetooth Plotter oferece gráficos de dados em tempo real no seu smartphone, por meio do app DIYables Bluetooth STEM. Projetado para placas ESP32, com suporte a conexões BLE (Bluetooth Low Energy) e Bluetooth Clássico. Plote até 10 séries de dados ao mesmo tempo, com eixos configuráveis, escala automática, rótulos de legenda e exibição com rolagem — perfeito para visualização de sensores, análise de sinais e monitoramento de dados.

Este exemplo oferece suporte a dois modos de Bluetooth:

  • ESP32 BLE (Bluetooth Low Energy): Funciona no Android e no iOS
  • ESP32 Bluetooth Clássico: Funciona somente no Android. O iOS não oferece suporte ao Bluetooth Clássico. Use o BLE se precisar de suporte ao iOS.
Exemplo de Plotter Bluetooth com ESP32 - Tutorial de Interface de Gráfico de Dados em Tempo Real

Recursos

  • Gráfico com Várias Séries: Plote até 10 séries de dados ao mesmo tempo
  • Exibição em Tempo Real: Gráfico com rolagem contínua e atualizações ao vivo
  • Eixos Configuráveis: Defina a faixa do eixo Y, os rótulos dos eixos e o título do gráfico
  • Escala Automática: Ajusta automaticamente a faixa do eixo Y para caber nos dados
  • Legendas Personalizadas: Dê um nome a cada série de dados para facilitar a identificação
  • Amostras Ajustáveis: Configure o número de pontos de dados visíveis
  • BLE e Bluetooth Clássico: Escolha o modo Bluetooth que melhor atende ao seu projeto
  • Multiplataforma: O modo BLE funciona no Android e no iOS; o Bluetooth Clássico funciona no Android

Código ESP32

Passos Rápidos

Siga estas instruções passo a passo:

  • Se esta é a primeira vez que você usa o ESP32, consulte o tutorial sobre como configurar o ambiente para o ESP32 no Arduino IDE.
  • Conecte a placa ESP32 ao seu computador usando um cabo USB.
  • Abra o Arduino IDE no seu computador.
  • Selecione a placa ESP32 e a porta COM apropriadas.
  • Acesse o ícone Libraries na barra à esquerda do Arduino IDE.
  • Pesquise "DIYables Bluetooth" e encontre a biblioteca DIYables Bluetooth, da DIYables
  • Clique no botão Install para instalar a biblioteca.
Biblioteca DIYables Bluetooth para ESP32
  • Será solicitado que você instale outras dependências da biblioteca
  • Clique no botão Install All para instalar todas as dependências da biblioteca.
Dependência da biblioteca DIYables Bluetooth para ESP32

Escolha um dos dois modos de Bluetooth abaixo, de acordo com a sua necessidade:

Código ESP32 Bluetooth Clássico (funciona com o app somente no Android)

Observação: O Bluetooth Clássico NÃO é compatível com o iOS. Se você precisa de suporte ao iOS, use o código BLE abaixo.

  • No Arduino IDE, vá em File Examples DIYables Bluetooth Esp32Bluetooth_Plotter, ou copie o código acima e cole no editor do Arduino IDE
/* * DIYables Bluetooth Library - ESP32 Classic Bluetooth Plotter Example * Works with DIYables Bluetooth STEM app on Android * Note: Classic Bluetooth is NOT supported on iOS. Use BLE examples for iOS support. * * This example demonstrates the Bluetooth Plotter feature: * - Real-time data plotting via Bluetooth * - Plot multiple data series simultaneously * - Configurable plot settings * * Compatible Boards: * - ESP32 (all variants with Classic Bluetooth) * - ESP32-WROOM-32 * - ESP32-DevKitC * - ESP32-WROVER * * Note: Select "Huge APP (3MB No OTA/1MB SPIFFS)" partition scheme * in Arduino IDE: Tools > Partition Scheme * * Setup: * 1. Upload the sketch to your ESP32 * 2. Open Serial Monitor (115200 baud) to see connection status * 3. Use DIYables Bluetooth App to connect and view the plot * * Tutorial: https://diyables.io/bluetooth-app * Author: DIYables */ #include <DIYables_BluetoothServer.h> #include <DIYables_BluetoothPlotter.h> #include <platforms/DIYables_Esp32Bluetooth.h> // Create Bluetooth instances DIYables_Esp32Bluetooth bluetooth("ESP32_Plotter"); DIYables_BluetoothServer bluetoothServer(bluetooth); // Create Plotter app instance DIYables_BluetoothPlotter bluetoothPlotter; // Variables for generating sample data unsigned long lastPlotTime = 0; const unsigned long PLOT_INTERVAL = 100; // Plot every 100ms float phase = 0; void setup() { Serial.begin(115200); delay(1000); Serial.println("DIYables Bluetooth - ESP32 Plotter Example"); // Initialize Bluetooth server with platform-specific implementation bluetoothServer.begin(); // Add plotter app to server bluetoothServer.addApp(&bluetoothPlotter); // Configure plotter settings bluetoothPlotter.setPlotTitle("Sensor Data"); bluetoothPlotter.setAxisLabels("Time", "Value"); bluetoothPlotter.setYAxisRange(-15, 30); // Fixed range bluetoothPlotter.setMaxSamples(100); // Show last 100 samples bluetoothPlotter.setLegendLabels("Sine", "Cosine", "Tangent"); // Custom legend labels // Uncomment to enable auto-scaling instead of fixed range: // bluetoothPlotter.enableAutoScale(true); // Set up connection event callbacks bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); }); // Optional: Handle requests for current plot data (when app loads) bluetoothPlotter.onDataRequest([]() { Serial.println("App requested plot data"); }); Serial.println("Waiting for Bluetooth connection..."); } void loop() { // Handle Bluetooth server communications bluetoothServer.loop(); // Send plot data at regular intervals if (millis() - lastPlotTime >= PLOT_INTERVAL) { lastPlotTime = millis(); // Generate sample data (sine and cosine waves) float sine = sin(phase); float cosine = cos(phase); float tangent = tan(phase) * 0.3; // Scaled down // Send data to Bluetooth plotter (multiple series) bluetoothPlotter.send(sine, cosine, tangent); // Also print to Serial for Arduino IDE Serial Plotter comparison Serial.print(sine, 2); Serial.print(" "); Serial.print(cosine, 2); Serial.print(" "); Serial.println(tangent, 2); phase += 0.1; if (phase > 2 * PI) { phase = 0; } // TODO: Replace sample data with your actual sensor readings // Examples: // - Temperature sensor: bluetoothPlotter.send(temperature); // - Accelerometer: bluetoothPlotter.send(accelX, accelY, accelZ); // - Multiple sensors: bluetoothPlotter.send(sensor1, sensor2, sensor3); } delay(10); }
  • Clique no botão Upload do Arduino IDE para carregar o código no ESP32
  • Abra o Serial Monitor
  • Confira o resultado no Serial Monitor. Ele deve ficar como abaixo:
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
New Line
9600 baud
DIYables Bluetooth - ESP32 Plotter Example Waiting for Bluetooth connection...
Ln 11, Col 1
ESP32 Dev Module on COM15
2

Código ESP32 BLE (funciona com o app no Android e no iOS)

  • No Arduino IDE, vá em File Examples DIYables Bluetooth Esp32BLE_Plotter, ou copie o código acima e cole no editor do Arduino IDE
/* * DIYables Bluetooth Library - ESP32 BLE Plotter Example * Works with DIYables Bluetooth STEM app on Android and iOS * * This example demonstrates the Bluetooth Plotter feature: * - Real-time data plotting via Bluetooth * - Plot multiple data series simultaneously * - Configurable plot settings * * Compatible Boards: * - ESP32-WROOM-32 * - ESP32-DevKitC * - ESP32-WROVER * - ESP32-S3 * - ESP32-C3 * - Any ESP32 board supporting BLE * * Note: Select "Huge APP (3MB No OTA/1MB SPIFFS)" partition scheme * in Arduino IDE: Tools > Partition Scheme * * Setup: * 1. Upload the sketch to your ESP32 * 2. Open Serial Monitor (115200 baud) to see connection status * 3. Use DIYables Bluetooth App to connect and view the plot * * Tutorial: https://diyables.io/bluetooth-app * Author: DIYables */ #include <DIYables_BluetoothServer.h> #include <DIYables_BluetoothPlotter.h> #include <platforms/DIYables_Esp32BLE.h> // BLE Configuration const char* DEVICE_NAME = "ESP32BLE_Plotter"; const char* SERVICE_UUID = "19B10000-E8F2-537E-4F6C-D104768A1214"; const char* TX_UUID = "19B10001-E8F2-537E-4F6C-D104768A1214"; const char* RX_UUID = "19B10002-E8F2-537E-4F6C-D104768A1214"; // Create Bluetooth instances DIYables_Esp32BLE bluetooth(DEVICE_NAME, SERVICE_UUID, TX_UUID, RX_UUID); DIYables_BluetoothServer bluetoothServer(bluetooth); // Create Plotter app instance DIYables_BluetoothPlotter bluetoothPlotter; // Variables for generating sample data unsigned long lastPlotTime = 0; const unsigned long PLOT_INTERVAL = 100; float phase = 0; void setup() { Serial.begin(115200); delay(1000); Serial.println("DIYables Bluetooth - ESP32 BLE Plotter Example"); // Initialize Bluetooth server with platform-specific implementation bluetoothServer.begin(); // Add plotter app to server bluetoothServer.addApp(&bluetoothPlotter); // Configure plotter settings bluetoothPlotter.setPlotTitle("Sensor Data"); bluetoothPlotter.setAxisLabels("Time", "Value"); bluetoothPlotter.setYAxisRange(-15, 30); bluetoothPlotter.setMaxSamples(100); bluetoothPlotter.setLegendLabels("Sine", "Cosine", "Tangent"); // Set up connection event callbacks bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); }); bluetoothPlotter.onDataRequest([]() { Serial.println("App requested plot data"); }); Serial.println("Waiting for Bluetooth connection..."); } void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= PLOT_INTERVAL) { lastPlotTime = millis(); float sine = sin(phase); float cosine = cos(phase); float tangent = tan(phase) * 0.3; bluetoothPlotter.send(sine, cosine, tangent); Serial.print(sine, 2); Serial.print(" "); Serial.print(cosine, 2); Serial.print(" "); Serial.println(tangent, 2); phase += 0.1; if (phase > 2 * PI) { phase = 0; } } delay(10); }
  • Clique no botão Upload do Arduino IDE para carregar o código no ESP32
  • Abra o Serial Monitor
  • Confira o resultado no Serial Monitor. Ele deve ficar como abaixo:
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
New Line
9600 baud
DIYables Bluetooth - ESP32 BLE Plotter Example Waiting for Bluetooth connection...
Ln 11, Col 1
ESP32 Dev Module on COM15
2

App para Celular

  • Instale o app DIYables Bluetooth no seu smartphone: Android | iOS
  • Se você estiver usando o código ESP32 Bluetooth Clássico, é preciso parear o ESP32 com o seu celular Android antes de abrir o app:
    • Vá em Configurações > Bluetooth do seu celular
    • Verifique se o Bluetooth está ligado
    • Seu celular vai procurar os dispositivos disponíveis
    • Encontre e toque em "ESP32_Plotter" na lista de dispositivos disponíveis
    • Confirme a solicitação de pareamento (não é necessário PIN)
    • Aguarde até aparecer "Paired" abaixo do nome do dispositivo
  • Se você estiver usando o código ESP32 BLE, não é necessário parear. Basta ir para o próximo passo.
  • Abra o app DIYables Bluetooth
  • Ao abrir o app pela primeira vez, ele vai pedir permissões. Conceda as seguintes:
    • Permissão de Dispositivos Próximos (Android 12+) / permissão de Bluetooth (iOS) - necessária para procurar e conectar a dispositivos Bluetooth
    • Permissão de Localização (somente Android 11 e anteriores) - exigida por versões mais antigas do Android para procurar dispositivos BLE
  • Verifique se o Bluetooth está ligado no seu celular
  • Na tela inicial, toque no botão Connect. O app vai procurar dispositivos BLE e Bluetooth Clássico.
App DIYables Bluetooth - Tela Inicial com Botão de Busca
  • Encontre e toque no seu dispositivo nos resultados da busca para conectar:
    • Para Bluetooth Clássico: toque em "ESP32_Plotter"
    • Para BLE: toque em "ESP32BLE_Plotter"
  • Depois de conectado, o app volta automaticamente para a tela inicial. Selecione o app Plotter no menu de apps.
App DIYables Bluetooth - Tela Inicial com o App Plotter

Observação: Você pode tocar no ícone de configurações na tela inicial para ocultar/mostrar apps. Para mais detalhes, consulte o Manual do Usuário do DIYables Bluetooth App.

  • Veja o gráfico de dados em tempo real rolando pela tela
App DIYables Bluetooth - Tela do Plotter

Agora olhe de volta para o Serial Monitor no Arduino IDE. Você verá:

∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32 Dev Module' on 'COM15')
New Line
9600 baud
Bluetooth connected! 0.00 1.00 0.00 0.10 1.00 -0.15 0.20 0.98 0.08 0.29 0.96 -0.22
Ln 11, Col 1
ESP32 Dev Module on COM15
2
  • O plotter exibe em tempo real ondas de seno, cosseno e ruído aleatório

Personalização Criativa - Adapte o Código ao Seu Projeto

Configure as Opções do Gráfico

Configure a aparência do gráfico antes da conexão:

// Set plot title bluetoothPlotter.setPlotTitle("Sensor Data"); // Set axis labels bluetoothPlotter.setAxisLabels("Time", "Value"); // Set fixed Y-axis range bluetoothPlotter.setYAxisRange(-15, 30); // Or enable auto-scaling instead bluetoothPlotter.enableAutoScale(true); // Set number of visible data points bluetoothPlotter.setMaxSamples(100); // Set legend labels for each data series bluetoothPlotter.setLegendLabels("Sine", "Cosine", "Tangent"); // Also supports 1, 2, or 4 labels: // bluetoothPlotter.setLegendLabels("Temperature"); // bluetoothPlotter.setLegendLabels("Temp", "Humidity"); // bluetoothPlotter.setLegendLabels("Ch1", "Ch2", "Ch3", "Ch4");

Enviar Dados para o Plotter

Várias sobrecargas para enviar de 1 a 4+ séries de dados:

// Send single value bluetoothPlotter.send(25.3); // Send two values (two series) bluetoothPlotter.send(temperature, humidity); // Send three values (three series) bluetoothPlotter.send(sine, cosine, tangent); // Send four values (four series) bluetoothPlotter.send(ch1, ch2, ch3, ch4); // Send array of values (any number of series) float values[] = {1.0, 2.0, 3.0, 4.0, 5.0}; bluetoothPlotter.send(values, 5); // Send as formatted string bluetoothPlotter.send("1.23,4.56,7.89");

Tratar a Solicitação de Dados do App

Quando o app se conecta e abre a tela do Plotter, ele pode solicitar dados:

bluetoothPlotter.onDataRequest([]() { Serial.println("App requested plot data"); // Optionally send initial data point });

Tratar Eventos de Conexão

bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); });

Como Usar o Plotter

Controles da Interface do App

A interface do plotter no app DIYables Bluetooth oferece:

  • Gráfico em Tempo Real: Gráfico de linhas com rolagem e várias séries
  • Legenda: Rótulos coloridos para cada série de dados
  • Rolagem Automática: Rola continuamente para mostrar os dados mais recentes

Formato dos Dados

Os dados são enviados como valores float separados por vírgula:

  • Série única: bluetoothPlotter.send(value)
  • Várias séries: bluetoothPlotter.send(val1, val2, val3)
  • Taxa de dados: Recomendamos um intervalo de 10-100ms para um gráfico suave

Exemplos de Programação

Gráfico de um Único Sensor

unsigned long lastPlotTime = 0; const unsigned long PLOT_INTERVAL = 100; // 10 Hz void setup() { bluetoothPlotter.setPlotTitle("Temperature"); bluetoothPlotter.setAxisLabels("Time", "°C"); bluetoothPlotter.setYAxisRange(0, 50); bluetoothPlotter.setLegendLabels("Temperature"); } void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= PLOT_INTERVAL) { lastPlotTime = millis(); float temperature = readTemperatureSensor(); bluetoothPlotter.send(temperature); } delay(10); }

Gráfico de Acelerômetro com Vários Eixos

#include <Wire.h> #include <MPU6050.h> MPU6050 mpu; unsigned long lastPlotTime = 0; void setup() { Wire.begin(); mpu.initialize(); bluetoothPlotter.setPlotTitle("Accelerometer"); bluetoothPlotter.setAxisLabels("Time", "g"); bluetoothPlotter.setYAxisRange(-2.0, 2.0); bluetoothPlotter.setLegendLabels("X", "Y", "Z"); } void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= 50) { // 20 Hz lastPlotTime = millis(); int16_t ax, ay, az; mpu.getAcceleration(&ax, &ay, &az); float gx = ax / 16384.0; float gy = ay / 16384.0; float gz = az / 16384.0; bluetoothPlotter.send(gx, gy, gz); } delay(10); }

Plotter de Pinos Analógicos

const int ANALOG_PINS[] = {34, 35, 36, 39}; const int NUM_CHANNELS = 4; void setup() { bluetoothPlotter.setPlotTitle("Analog Inputs"); bluetoothPlotter.setAxisLabels("Time", "ADC Value"); bluetoothPlotter.setYAxisRange(0, 4095); bluetoothPlotter.setMaxSamples(200); bluetoothPlotter.setLegendLabels("A34", "A35", "A36", "A39"); } void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= 100) { lastPlotTime = millis(); float values[NUM_CHANNELS]; for (int i = 0; i < NUM_CHANNELS; i++) { values[i] = analogRead(ANALOG_PINS[i]); } bluetoothPlotter.send(values, NUM_CHANNELS); } delay(10); }

Gerador de Sinais

float phase = 0; void setup() { bluetoothPlotter.setPlotTitle("Signal Generator"); bluetoothPlotter.setAxisLabels("Time", "Amplitude"); bluetoothPlotter.setYAxisRange(-1.5, 1.5); bluetoothPlotter.setLegendLabels("Sine", "Square", "Triangle"); } void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= 50) { lastPlotTime = millis(); float sine = sin(phase); float square = (sin(phase) > 0) ? 1.0 : -1.0; float triangle = 2.0 * abs(fmod(phase / PI, 2.0) - 1.0) - 1.0; bluetoothPlotter.send(sine, square, triangle); phase += 0.1; if (phase > 2 * PI) phase -= 2 * PI; } delay(10); }

Técnicas Avançadas de Programação

Filtro de Média Móvel

class MovingAverage { float buffer[10]; int index = 0; int count = 0; public: float add(float value) { buffer[index] = value; index = (index + 1) % 10; if (count < 10) count++; float sum = 0; for (int i = 0; i < count; i++) sum += buffer[i]; return sum / count; } }; MovingAverage filter1, filter2; void loop() { bluetoothServer.loop(); if (millis() - lastPlotTime >= 100) { lastPlotTime = millis(); float raw = analogRead(34) * 3.3 / 4095.0; float filtered = filter1.add(raw); // Plot both raw and filtered values bluetoothPlotter.send(raw, filtered); } delay(10); }

Configuração Dinâmica do Gráfico

// Change plot settings at runtime void switchToTemperatureMode() { bluetoothPlotter.setPlotTitle("Temperature Monitor"); bluetoothPlotter.setAxisLabels("Time", "°C"); bluetoothPlotter.setYAxisRange(-10, 50); bluetoothPlotter.setLegendLabels("Internal", "External"); } void switchToVoltageMode() { bluetoothPlotter.setPlotTitle("Voltage Monitor"); bluetoothPlotter.setAxisLabels("Time", "°C"); bluetoothPlotter.setYAxisRange(0, 3.3); bluetoothPlotter.setLegendLabels("Ch1", "Ch2", "Ch3"); }

BLE vs Bluetooth Clássico - Qual Escolher?

RecursoBLE (Esp32BLE_Plotter)Bluetooth Clássico (Esp32Bluetooth_Plotter)
Suporte ao iOS? Sim? Não
Suporte ao Android? Sim? Sim
Consumo de EnergiaBaixoMaior
Alcance~30-100m~10-100m
Taxa de DadosMenorMaior
Pareamento NecessárioNão (conexão automática)Sim (pareamento manual)
Ideal ParaAlimentado por bateria, multiplataformaAlta taxa de transferência, somente Android

Solução de Problemas

Problemas Comuns

1. Não consigo encontrar o dispositivo no app

  • Verifique se o ESP32 está ligado e se o sketch foi carregado
  • Para BLE: verifique se o Bluetooth e a Localização do seu celular estão ativados
  • Para Bluetooth Clássico: pareie o dispositivo primeiro nas configurações de Bluetooth do celular
  • Verifique se o esquema de partição correto está selecionado (Huge APP)

2. O gráfico não está atualizando

  • Verifique o status da conexão Bluetooth no app
  • Verifique se bluetoothPlotter.send() está sendo chamado no loop
  • Verifique se bluetooth.isConnected() retorna true
  • Tente desconectar e reconectar

3. Os dados do gráfico parecem entrecortados

  • Reduza o intervalo do gráfico (por exemplo, 50ms em vez de 500ms)
  • Garanta uma conexão Bluetooth estável
  • Reduza o número de séries de dados se a largura de banda for limitada

4. A faixa do eixo Y não se ajusta aos dados

  • Use enableAutoScale(true) para ajuste automático
  • Ou defina uma faixa maior com setYAxisRange()

5. Os rótulos da legenda não aparecem

  • Chame setLegendLabels() antes de a conexão ser estabelecida
  • Faça o número de rótulos corresponder ao número de séries de dados

6. Sketch grande demais / espaço insuficiente

  • No Arduino IDE, vá em Tools > Partition Scheme e selecione "Huge APP (3MB No OTA/1MB SPIFFS)" ou "No OTA (Large APP)"
  • O esquema de partição padrão oferece apenas ~1,2MB para o código do app, o que não é suficiente para as bibliotecas de Bluetooth
  • Essa configuração oferece ~3MB ao sacrificar a partição de OTA (atualização over-the-air)

Dicas de Depuração

Adicione uma depuração completa:

void debugPlotterData(float v1, float v2, float v3) { Serial.println("=== Plotter Debug ==="); Serial.println("Value 1: " + String(v1, 2)); Serial.println("Value 2: " + String(v2, 2)); Serial.println("Value 3: " + String(v3, 2)); Serial.println("Free Heap: " + String(ESP.getFreeHeap())); Serial.println("====================="); }

Ideias de Projetos

Monitoramento de Sensores

  • Exibição de tendência de temperatura e umidade
  • Monitoramento do nível de luz ao longo do dia
  • Rastreamento de movimento com acelerômetro
  • Visualização de dados de sensor de pressão

Análise de Sinais

  • Visualizador de frequência de áudio
  • Monitoramento de vibração
  • Exibição de pulso/frequência cardíaca
  • Intensidade de campo eletromagnético

Educação

  • Comparação das ondas seno, cosseno e tangente
  • Curvas de carga/descarga de circuito RC
  • Visualização da resposta de um controlador PID
  • Registrador de dados de experimentos de física

Industrial

  • Monitoramento de vibração de máquinas
  • Tendência de variáveis de processo
  • Acompanhamento do consumo de energia
  • Gráficos de controle de qualidade

Integração com Outros Apps Bluetooth

Combine com o Bluetooth Slider

Use sliders para controlar os parâmetros do sinal plotado:

float frequency = 1.0; float amplitude = 1.0; bluetoothSlider.onSliderValue([](int slider1, int slider2) { frequency = map(slider1, 0, 100, 1, 20) / 10.0; amplitude = slider2 / 100.0; }); // In loop: float value = amplitude * sin(phase * frequency); bluetoothPlotter.send(value);

Combine com o Bluetooth Table

Mostre os valores atuais em uma tabela junto com o gráfico:

bluetoothTable.sendValueUpdate("Current", String(currentValue, 2)); bluetoothTable.sendValueUpdate("Max", String(maxValue, 2)); bluetoothTable.sendValueUpdate("Min", String(minValue, 2)); bluetoothTable.sendValueUpdate("Average", String(average, 2));

Próximos Passos

Depois de dominar o exemplo Bluetooth Plotter, experimente:

  1. Bluetooth Temperature - Para exibição dedicada de temperatura
  2. Bluetooth Analog Gauge - Para visualização no estilo de medidor
  3. Bluetooth Table - Para dados numéricos estruturados
  4. Multiple Bluetooth Apps - Combinando o plotter com outros displays

Suporte

Para obter mais ajuda:

  • Consulte a documentação de referência da API
  • Fóruns da comunidade Arduino

※ NOSSAS MENSAGENS

  • Fique à vontade para compartilhar o link deste tutorial. Porém, por favor, não use nosso conteúdo em outros sites. Investimos muito esforço e tempo para criar este conteúdo, por favor respeite nosso trabalho!