<\/a><\/p>\nCon un simple LM 317 y un preset de 5K en su Adj puedes tener un regulador de 3.3Volts 1 Amp…<\/p>\n
B\u00e1sicamente conectamos directamente el m\u00f3dulo BLUETOOTH en nuestra placa PINGUINO… sin nada de intermediario y se entender\u00e1n perfectamente, ya que la placa PINGUINO posee unas resistencias de acople que ayudan al dialogo correcto.<\/p>\n
El codigo es simple. Escribo como si fuese un puerto serie normalito… y espero respuestas… en este caso, mido la temperatura y la luminosidad mediante entradas anal\u00f3gicas, y como punto adicional, controlo un LED colocado en el puerto 0. Todo esto con retroalimentaci\u00f3n a la consola serie.<\/p>\n
[sourcecode language=\u00bbpy\u00bb]
\n\/\/ Bluetooth comunication v 1
\n\/\/ Walter L\u00f3pez (walterleonardo & walii) 2011 pinguino.walii.es<\/p>\n
char *string = "Hola mundo bluetooth!!! estoy vivo… soy pinguino";
\n#define LM35 18
\n#define LDR 17
\n#define LED 0<\/p>\n
int i=0;<\/p>\n
temp(){
\nint aux=0,buffer[10];
\nfor (i=0;i<9;i++){
\nbuffer[i]=analogRead(LM35);
\naux = aux + buffer[i];
\n}
\naux = (aux \/ 10);
\naux = aux\/2;
\nreturn aux;
\n}<\/p>\n
light(){
\nint aux=0,buffer[10];
\nfor (i=0;i<9;i++){
\nbuffer[i]=analogRead(LDR);
\naux = aux + buffer[i];
\n}
\naux = (aux \/ 10);
\naux = (aux-23)\/10;
\naux = 100-aux;
\nreturn aux;
\n}<\/p>\n
void setup()
\n{
\n\tSerial.begin(9600);
\n\tpinMode(LED,OUTPUT);
\n\tdigitalWrite(LED,LOW);
\n\tSerial.printf("\\r\\n");
\n\tSerial.printf("****************************************\\r\\n");
\n\tSerial.printf("*** PRUEBA de comunicacion BLUETOOTH ***\\r\\n");
\n\tSerial.printf("****************************************\\r\\n");
\n\tSerial.printf("\\r\\n");
\n}
\nvoid loop()
\n{
\nu8 c;
\n\tSerial.printf("****** %s\\r\\n", string);
\n\t\tSerial.printf("\\r\\n");
\n\t\t\tSerial.printf("\\r\\n");
\n\tSerial.printf("Press t key to receive the temperature …\\r\\n");
\n\tSerial.printf("Press l key to receive the Light level …\\r\\n");
\n\tSerial.printf("Press x key to change the LED status …\\r\\n");
\nc = Serial.getkey();
\nSerial.printf("=========================================\\r\\n");
\nif (c == 116) Serial.printf("Temperature = %u degrees Celsius\\n\\r" , temp());
\nif (c == 108) Serial.printf("Light = %u Percentage\\n\\r" , light());
\nif (c == 120) digitalWrite(LED,(digitalRead(LED)^1)), Serial.printf("Changed LED Status \\n\\r");
\nSerial.printf("=========================================\\r\\n");
\n\tSerial.printf("\\r\\n");<\/p>\n
}<\/p>\n
[\/sourcecode]<\/p>\n","protected":false},"excerpt":{"rendered":"
Bueno hoy al fin pude terminar el proyecto bluetooth, lo tengo parado hace un par de semanas porque estoy en medio de un curso de…<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13,3,4,15],"tags":[],"_links":{"self":[{"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/posts\/551"}],"collection":[{"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=551"}],"version-history":[{"count":6,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":560,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=\/wp\/v2\/posts\/551\/revisions\/560"}],"wp:attachment":[{"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pinguino.walii.es\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}