Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connecting nRF52840 DK to MC3672 Accelerometer and nRF52840 Dongle to Mac

Hi, 

I'm attempting to obtain sensor values for a project to be completed less than a week from now and I have not yet started programming so any help would be greatly appreciated. 

My project consists of an MC3672 accelerometer on a breadboard, connected by four wires to the nRF52840 DK. The output sensor values should be transferred to the DK using either SPI or I2C and then from the DK to the nRF52840 dongle which will be connected to my Mac, via BLE. My Mac should then read and display the output data values after having received the data from the dongle through the USB port. 

I'm really struggling to find any example code for interfacing the accelerometer (as a slave) and the DK (as a master). Most examples like the SPI Slave Example: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/spi_slave_example.html prompt me to 'connect the board to another board that runs the SPI Master Example' during testing but I'm only using one DK, so I'm pretty sure that the example code won't work.

Does anyone know any way I could change the SPI Slave Example code to have the accelerometer as the slave and the DK as the master? How would I go about doing it?  

I'm also struggling to find example code for interfacing the DK with the dongle, and how to read the sensor values on my Mac. 

Any help (with example code or links to resources or similar projects) would be really appreciated as this is a time-limited project and I'm a complete beginner when it comes to Nordic devices. 

Thank you. 

Related