-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuto Final.ino
More file actions
43 lines (33 loc) · 873 Bytes
/
Auto Final.ino
File metadata and controls
43 lines (33 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "DefinicionesPuertos.h"
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(10, 11); // RX, TX
String numero;
void setup() {
// Open serial communications and wait for port to open:
pinMode(9, OUTPUT);
Serial.begin(9600);
bluetooth.begin(9600); //esto es para cuando esta funcionando ya configurado
//bluetooth.begin(38400); en modo configuracion AT
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Configuracion:");
// set the data rate for the SoftwareSerial port
}
void loop() { // run over and over
while (bluetooth.available()) {
char a = bluetooth.read();
if (a != 'A') {
numero += a;
}
else {
Serial.println(numero.toInt());
analogWrite(9, numero.toInt());
numero = "";
}
}
/*
if (Serial.available()) {
bluetooth.write(Serial.read());
}*/
}