Arduino windows code to Android application with bluetooth
$30-250 USD
En curso
Publicado hace más de 8 años
$30-250 USD
Pagado a la entrega
I have an arduino project running on windows, and I want it to work with android.
It connects the device trough bluetoogh, receive a value from 3 possibles and depending on the value apk shows a message.
Stilish is not such a deal at this momment: connect button, result area and logo background to do at the end.
I will release the first milestone when I test the apk, and the second payment with the source code.
Here is the code it was used for windows:
const int pin = 2;
const int trigger = 3;
volatile int contador = 0;
volatile int contador_mostrar = 0;
volatile bool bListo = false;
int contador_anterior=0;
unsigned long tiempo = 25.0;
unsigned long tiemporeal= 0;
char* ctexto="";
void ServicioBoton(){
delayMicroseconds(30);
if (digitalRead(pin))contador++;
}
void Reloj(){
contador_mostrar=contador;
contador=0;
bListo=true;
}
void setup()
{
pinMode(pin, INPUT);
pinMode(trigger, INPUT);
[login to view URL](9600);
attachInterrupt(digitalPinToInterrupt(pin), ServicioBoton, RISING);
attachInterrupt(digitalPinToInterrupt(trigger),Reloj,CHANGE);
}
void loop()
{
if (bListo){
if (contador_anterior != contador_mostrar){
if (contador_mostrar <= 2) ctexto= "Invalida";
if (contador_mostrar == 3) ctexto= "Negativa";
if ((contador_mostrar >= 4) && (contador_mostrar <=5)) ctexto="Positiva";
contador_anterior=contador_mostrar;
}//fin contador diferente al anterior
bListo=false;
}//fin listo
if ([login to view URL]()){
[login to view URL] (ctexto);
}
}//fin void loop
Here is the code