Hello,
I am trying to read data from a sensor through sensor TX pin connected to RX pin of nrf51822.
Nrf51822 recieves this data through RX pin and sends it via bluetooth to Android App.
I have this simple code i wrote in arduino, but don't know how to implement it in nrf51822.
bittpos = 0;
while(Serial.available())
{
if(bittpos < 4){
mbufer[bittpos++] = Serial.read();
}else break;
}
Serial.flush();
mdata = (mbufer[1] * 256) + mbufer[2];
// Print out sensor data
Serial.println(mdata);
I've gone through the UART sample code. But i don't know where to start from in implementing the above code.