際際滷

際際滷Share a Scribd company logo
Programa de control del tel辿fono m坦vil
Configuracion du modulo HC-06
char NOMBRE[10] = "PONYZ";
char BPS = '4'; // 1=1200 , 2=2400, 3=4800, 4=9600, 5=19200, 6=38400, 7=57600, 8=115200
char PASS[10] = "0000";
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
delay(10000);
digitalWrite(13,LOW);
Serial.print("AT");
delay(1000);
Serial.print("AT+NAME");
Serial.print(NOMBRE);
delay(1000);
Serial.print("AT+BAUD");
Serial.print(BPS);
delay(1000);
Serial.print("AT+PIN");
Serial.print(PASS);
delay(1000);
}
void loop()
{
digitalWrite(13, !digitalRead(13));
delay(500);
}
Programa de control de un coche Bluetooch
void setup() {
// inicializacion de comunicacion serial:
Serial.begin(9600);
// inicializa los pines de los LEDs:
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
}
void loop() {
// lectura del sensor
if (Serial.available() > 0) {
int inByte = Serial.read();
switch (inByte)
{
case 'A':
digitalWrite(12, LOW);
digitalWrite(13, LOW);
break;
case 'I':
digitalWrite(13, LOW);
break;
case 'D':
digitalWrite(12, LOW);
break;
default:
// enciende los LEDs:
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
}
}
}

More Related Content

Programa de control de un coche bluetooch

  • 1. Programa de control del tel辿fono m坦vil Configuracion du modulo HC-06 char NOMBRE[10] = "PONYZ"; char BPS = '4'; // 1=1200 , 2=2400, 3=4800, 4=9600, 5=19200, 6=38400, 7=57600, 8=115200 char PASS[10] = "0000"; void setup() { Serial.begin(9600); pinMode(13,OUTPUT); digitalWrite(13,HIGH); delay(10000); digitalWrite(13,LOW); Serial.print("AT"); delay(1000); Serial.print("AT+NAME"); Serial.print(NOMBRE); delay(1000); Serial.print("AT+BAUD"); Serial.print(BPS); delay(1000); Serial.print("AT+PIN"); Serial.print(PASS); delay(1000);
  • 2. } void loop() { digitalWrite(13, !digitalRead(13)); delay(500); } Programa de control de un coche Bluetooch void setup() { // inicializacion de comunicacion serial: Serial.begin(9600); // inicializa los pines de los LEDs: pinMode(12, OUTPUT); pinMode(13, OUTPUT); digitalWrite(12, HIGH); digitalWrite(13, HIGH); } void loop() { // lectura del sensor if (Serial.available() > 0) { int inByte = Serial.read(); switch (inByte) { case 'A': digitalWrite(12, LOW);
  • 3. digitalWrite(13, LOW); break; case 'I': digitalWrite(13, LOW); break; case 'D': digitalWrite(12, LOW); break; default: // enciende los LEDs: digitalWrite(12, HIGH); digitalWrite(13, HIGH); } } }