Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- DiegoRivera
- Date:
- 2016-02-25
- Revision:
- 2:f9a8ccac21e4
- Parent:
- 1:1c8a6c4ddc4f
File content as of revision 2:f9a8ccac21e4:
#include "mbed.h"
#include "Cerradura.h"
//DigitalOut cerradura (D2);
//DigitalOut gnd(D2);
//DigitalOut vcc(D3);
//DigitalOut en(D4);
Serial bluetooth(PTE0, PTE1);
Cerradura cerradura(D2); //clase para abrir y crrar cerradura
Cerradura rojo(LED1);
Cerradura verde(LED2);
void leer() //interrupcion rx serial
{
int in;
bluetooth.scanf("%d", &in);
if(in==1)
{
cerradura.abrir();
rojo.abrir();
verde.cerrar();
bluetooth.printf("1");
}
if(in==0)
{
cerradura.cerrar();
rojo.cerrar();
verde.abrir();
bluetooth.printf("0");
}
}
int main()
{
// gnd=0;
// vcc=1;
// en=1;
bluetooth.baud(9600);
bluetooth.format(8, SerialBase::None, 1);
bluetooth.attach(&leer, Serial::RxIrq);
while(1)
{
}
}