Skip to content

Commit bd72261

Browse files
committed
i2c-support:sample: update README
Signed-off-by: Dhruva Gole <[email protected]>
1 parent 472bfba commit bd72261

File tree

2 files changed

+6
-59
lines changed

2 files changed

+6
-59
lines changed

samples/i2cdemo/README.rst

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,28 @@
1-
.. _blinky-sample:
2-
3-
Blinky
1+
i2c demo
42
######
53

64
Overview
75
********
86

9-
This Arduino Blinky sample blinks an LED forever using the `ArduinoAPI`.
7+
This Arduino i2c sample gets data from an ADXL345 sensor connected over `i2c0`.
108

119
Requirements
1210
************
1311

1412
Your board must:
1513

16-
#. Have an LED connected via a GPIO pin (these are called "User LEDs" on many of
17-
Zephyr's :ref:`boards`).
18-
#. Have the LED configured using the ``led0`` devicetree alias.
14+
#. Have atleast 1 i2c port.
15+
#. Have the ADXL345 sensor connected to the I2C port.
1916

2017
Building and Running
2118
********************
2219

2320
Build and flash Blinky as follows,
2421

2522
```sh
26-
$> west build -p -b arduino_nano_33_ble samples/basic/arduino-blinky/ -DZEPHYR_EXTRA_MODULES=/home/$USER/zephyrproject/modules/lib/Arduino-Core-Zephyr
23+
$> west build -p -b arduino_nano_33_ble samples/i2cdemo
2724
2825
$> west flash --bossac=/home/$USER/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac
2926
```
3027

31-
After flashing, the LED starts to blink. If a runtime error occurs, the sample
32-
exits without printing to the console.
33-
34-
Adding board support
35-
********************
36-
37-
To add support for your board, add something like this to your devicetree:
38-
39-
.. code-block:: DTS
40-
41-
/ {
42-
aliases {
43-
led0 = &myled0;
44-
};
45-
46-
leds {
47-
compatible = "gpio-leds";
48-
myled0: led_0 {
49-
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
50-
};
51-
};
52-
};
53-
54-
The above sets your board's ``led0`` alias to use pin 13 on GPIO controller
55-
``gpio0``. The pin flags :c:macro:`GPIO_ACTIVE_HIGH` mean the LED is on when
56-
the pin is set to its high state, and off when the pin is in its low state.
57-
58-
Tips:
59-
60-
- See :dtcompatible:`gpio-leds` for more information on defining GPIO-based LEDs
61-
in devicetree.
62-
63-
- If you're not sure what to do, check the devicetrees for supported boards which
64-
use the same SoC as your target. See :ref:`get-devicetree-outputs` for details.
65-
66-
- See :zephyr_file:`include/zephyr/dt-bindings/gpio/gpio.h` for the flags you can use
67-
in devicetree.
68-
69-
- If the LED is built in to your board hardware, the alias should be defined in
70-
your :ref:`BOARD.dts file <devicetree-in-out-files>`. Otherwise, you can
71-
define one in a :ref:`devicetree overlay <set-devicetree-overlays>`.
28+
After flashing, probe the UART pin (TX) and you should be able to see X, Y and Z values if everything goes well.

samples/i2cdemo/sample.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)