nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TWI Master Example

Modules

 main.c
 TWI Master Example Application main file.
 

Detailed Description

The TWI Master Example project demonstrates the initialization and reading of sensors using the a Two Wire Interface (TWI) driver.

Note
By default this example uses a bit-banged software TWI driver. The API is exactly the same for the hardware TWI driver. Therefore, twi_sw_master.c can be swapped out for the twi_hw_master.c to use on-chip hardware to achieve the same results.

Temperature sensor ds1624:

Touchpad sensor:

Setup

Instructions on how to set up the nRFgo Motherboard: nRFgo Motherboard Setup (nRF6310).

The touchpad pin setup:

LED assignments:

Testing

TWI Master Example Application can be tested as follows:

  1. Compile and program the application.
  2. LED 0 to LED 6 should show the binary value of the temperature read from the ds1624 temperature sensor.
  3. LED 7 should be turned on if a touchpad button (Behind the touchpad) is pressed.