This is a Bluetooth 4.0 module(Bluetooth 4.0 slave module). Compared with Bluetooth version 2.0 and 3.0, it's more advanced for its lower power consumption. You can easily connect your own project to the primary device of Bluetooth 4.0 by using this module. For instance, it can transfer the detected data which is about the information of your body to phone for displaying or analyzing, then, help you better manage your physical condition.
The demo is going to show you how to connect bluetooth device with Xadow BLE Slave and communicate. You can use it to communicate with phone(with Bluetooth 4.0). Now let us have a test:
Note: when connect XadowBLE Slave to Xadow Main Board, you should concern about the connection direction. The connection method is that the unfilled corner of one Xadow module need to connect to the right angle of another module(see four corners of each Xadow module).
int error=0; int n; void setup() { Serial.begin(38400); delay(100); PORTB|=0x04; TESTIO(); if(error==0) { DDRB|=0x81; for(n=0;n<40;n++) { PORTB&=~0x81; delay(50); PORTB|=0x81; } } Serial1.begin(38400); } void loop() { boot(); } void TESTIO(void) { DDRB|=0x0e; PORTB&=~0x0e; DDRF|=0x01; PORTF&=~0x01; DDRD&=~0x0f; PORTB|=0x04; PORTF|=0x01; delay(30); if(!(PIND&0x01)) { error=1; } if(PIND&0x02) { error=1; } if(!(PIND&0x04)) { error=1; } if(PIND&0x08) { error=1; } PORTB&=~0x04; PORTB|=0x0a; PORTF&=~0x01; delay(30); if(PIND&0x01) { error=1; } if(!(PIND&0x02)) { error=1; } if(PIND&0x04) { error=1; } if(!(PIND&0x08)) { error=1; } Serial.println(error); } void boot(void) { for(;;) { if(Serial.available()) { Serial1.write(Serial.read()); } if(Serial1.available()) { Serial.write(Serial1.read()); } } }