Giter Club home page Giter Club logo

nrf9160_i2c_example's Introduction

nrf9160 Direct Access I2C example code.

This code demonstrates:

  • I2C scanner (more or less ripped ad verbatim from the internet)
  • Low level Chipcap2 I2C communication (from Air Quality Sensor Node )

Note:

  • If you want to use i2c0,1,3, and the driver doesn't load, it is a good idea to check the various I2C nodes in the compiled dts (build/zephyr/zephyr.dts). They will either be marked as "okay" or "disabled".
  • The code is tested on nRF9160DK using nRF Connect SDK v.2.5.0 (SCL: 31, SDA:30).
  • The example code is using i2c2, since this is enabled by default.
  • Chipcap2 application guide
  • Don't forget to add pullup resistors between the SDA/SCL and VDD (4.7k-10k).

Example output

I2C Scanner

*** Booting nRF Connect SDK v2.5.0 ***
The I2C scanner started 
Value of NRF_TWIM2->PSEL.SCL : -1  
Value of NRF_TWIM2->PSEL.SDA : -1 
Value of NRF_TWIM2->FREQUENCY: 67108864  
26738688 -> 100k 
I2C device found at address 0x28

Chipcap2

*** Booting nRF Connect SDK v2.5.0 *** 

Sample : 0
Temp: 25.8
RH: 34

Sample : 1
Temp: 25.8
RH: 34

Sample : 2
Temp: 25.8
RH: 35

nrf9160_i2c_example's People

Contributors

hansj66 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.