HI
would someone know how to get the mac address of the itsby bitsby from Arduino IDE?
The Arduino Bluefruit library seems to have a function getAddr().. howvever I m unable to program it properly!
Many thanks
/**
* Get current Mac address and its type
* @param mac address
* @return Address type e.g BLE_GAP_ADDR_TYPE_RANDOM_STATIC
*/
uint8_t AdafruitBluefruit::getAddr (uint8_t mac[6])
{
ble_gap_addr_t gap_addr;
sd_ble_gap_addr_get(&gap_addr);
memcpy(mac, gap_addr.addr, 6);
return gap_addr.addr_type;
}
Itsby Bitsby NRF 52 - Mac address
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mikeysklar
- Posts: 14194
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Itsby Bitsby NRF 52 - Mac address
The DEVICEADDR0 and DEVICEADDR1 should show the combined BLE address for your Itsy Bitsy. You can try printing those values out assuming you are using the Adafruit_nRF52_Arduino code.
https://github.com/adafruit/Adafruit_nR ... nrf52810.h
Here is an example of how the Arduino BLE library does it just slightly different, but a helpful example.
https://forum.arduino.cc/t/board-serial-number/661803
https://github.com/adafruit/Adafruit_nR ... nrf52810.h
Here is an example of how the Arduino BLE library does it just slightly different, but a helpful example.
Code: Select all
#include <ArduinoBLE.h>
void setup()
{
Serial.begin( 9600 );
while ( !Serial );
}
void loop()
{
Serial.print( "Device ID 0: " );
Serial.println( NRF_FICR->DEVICEID[0], HEX );
Serial.print( "Device ID 1: " );
Serial.println( NRF_FICR->DEVICEID[1], HEX );
Serial.print( "Device Address 0: " );
Serial.println( NRF_FICR->DEVICEADDR[0], HEX );
Serial.print( "Device Address 1: " );
Serial.println( NRF_FICR->DEVICEADDR[1], HEX );
delay ( 5000 );
}
Please be positive and constructive with your questions and comments.