-
Fototrend
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Gergosz2
veterán
de volt olyan, hogy a program pl <d2122>-t küldött?
Ha nem akkor próbáld meg, hogy a while ciklusból kiveszed a delay-t. Ha az sem megy akkor ezt próbáld meg:
#include <SoftwareSerial.h>
int bluetoothTx = 2;
int bluetoothRx = 3;
int ledPin = 11;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
String readString;
bool ok=false;
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop() {
while (bluetooth.available()) {
char c = bluetooth.read ();
if (c != '<' && c != 'd' && c != '>' )
{
readString += c;
}
if (c=='>') {
ok=true;
}
}
if (ok==true) {
int szam = readString.toInt();
Serial.println(szam);
readString = "";
analogWrite(ledPin, szam);
ok=false;
}
}
Új hozzászólás Aktív témák
- 151 - Lenovo LOQ (15IAX9) - Intel Core i5-12450HX, RTX 4060
- Olcsó Notebook! Dell Latitude E7280! I5 7300U / 8GB DDR4 / 256GB SSD!
- HIBÁTLAN iPhone 11 Pro 64GB Space Grey -1 ÉV GARANCIA - Kártyafüggetlen, MS3538
- Nagyakkus! Dell Latitude 5430 i7-1255U 16GB 512GB 14" FHD 1 év garancia
- Lenovo Thinkcentre M920t Tower/ M720s / M920s SFF / i5-8-9. gen/ WIN10-11/számla, garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest