Skip to content

Commit 034b818

Browse files
authored
I2C Example Guide Structure Fix (#9)
- restructure of example procedure section
1 parent 3ebb6d2 commit 034b818

10 files changed

+66
-68
lines changed

source/amebapro2/Example_Guides/I2C/Display Data on LCD Screen.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
Normally there are many pins on an LCD display, as shown below.
2222

@@ -26,23 +26,23 @@ An LCD display can be equipped with an additional processing chip to process the
2626
using the I2C interface.
2727

2828
Procedure
29-
---------
29+
~~~~~~~~~
3030

3131
**AMB82 Mini** wiring diagram:
3232

3333
|image02|
3434

35-
| Open the example in File -> Examples -> AmebaWire -> LCD_HelloWorld.
35+
| Open the example in "File" -> "Examples" -> "AmebaWire" -> "LCD_HelloWorld".
3636
| Compile and upload to Ameba, then press the reset button.
37-
| You can now see Hello World in the first line, and Ameba in the second line displayed on the LCD screen.
37+
| You can now see "Hello World" in the first line, and "Ameba" in the second line displayed on the LCD screen.
3838
3939
|image03|
4040

4141
After 8 seconds, you can input to the Serial Monitor the string you would like to display on the LCD.
4242

4343
|image04|
4444

45-
For example, we enter 123456789 and press Send:
45+
For example, we enter "123456789" and press "Send":
4646

4747
|image05|
4848

source/amebapro2/Example_Guides/I2C/MPU6050 DMP6 ImuData for ROS.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
This example will demonstrate getting the data from MPU6050 with DMP6.
2222
MPU6050 is equipped with a Digital Motion Processor (DMP) to handle the
@@ -27,13 +27,13 @@ acceleration, adjusted to remove gravity, and rotated based on known
2727
orientation from quaternion.
2828

2929
Procedure
30-
---------
30+
~~~~~~~~~
3131

3232
Connect the MPU6050 to I2C_SDA and I2C_SCL of the board as shown in the diagram below.
3333

3434
|image01|
3535

36-
Open the example in File -> Examples -> AmebaWire -> MPU6050-> MPU6050_DMP6_ImuData_for_ROS.ino.
36+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "MPU6050"-> "MPU6050_DMP6_ImuData_for_ROS.ino".
3737

3838
|image02|
3939

source/amebapro2/Example_Guides/I2C/MPU6050 DMP6.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
This example will demonstrate getting the data from MPU6050 with DMP6.
2222
MPU6050 is equipped with a Digital Motion Processor (DMP) to handle the
@@ -33,14 +33,14 @@ For MPU6050_DMP6.ino, the DMP library version is 2.0. For
3333
MPU6050_DMP6_using_DMP_V6v12.ino, the DMP library version is 6.12.
3434

3535
Procedure
36-
---------
36+
~~~~~~~~~
3737

3838
Connect the MPU6050 to I2C_SDA and I2C_SCL of the board as shown in the
3939
diagram below.
4040

4141
|image01|
4242

43-
Open the example in File -> Examples -> AmebaWire -> MPU6050-> MPU6050_DMP6 OR MPU6050_DMP6_using_DMP_V6v12
43+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "MPU6050"-> "MPU6050_DMP6" OR "MPU6050_DMP6_using_DMP_V6v12"
4444

4545
|image02|
4646

source/amebapro2/Example_Guides/I2C/MPU6050 IMU Zero.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
This example will demonstrate how to do calibration for the MPU6050 IMU.
2222

2323
Procedure
24-
---------
24+
~~~~~~~~~
2525

2626
Connect the MPU6050 to I2C_SDA and I2C_SCL of the board as shown in the diagram below.
2727

2828
|image01|
2929

30-
Open the example in File -> Examples -> AmebaWire -> MPU6050-> MPU6050_IMU_Zero
30+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "MPU6050"-> "MPU6050_IMU_Zero"
3131

3232
|image02|
3333

source/amebapro2/Example_Guides/I2C/MPU6050 Raw Data.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
This example will demonstrate getting the raw data from MPU6050.
2222

2323
Procedure
24-
---------
24+
~~~~~~~~~
2525

2626
Connect the MPU6050 to I2C_SDA and I2C_SCL of the board as shown in the diagram below.
2727

2828
|image01|
2929

30-
Open the example in File -> Examples -> AmebaWire -> MPU6050-> MPU6050_raw.
30+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "MPU6050"-> "MPU6050_raw".
3131

3232
|image02|
3333

source/amebapro2/Example_Guides/I2C/Master Receive Data from Arduino UNO.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,44 @@ Materials
1515
Example
1616
-------
1717

18-
Introduction of I2C
19-
-------------------
18+
I2C Introduction
19+
~~~~~~~~~~~~~~~~
2020

21-
There are two roles in the operation of I2C, one is master, the other
22-
is slave. Only one master is allowed and can be connected to many
21+
There are two roles in the operation of I2C, one is "master", the other
22+
is "slave". Only one master is allowed and can be connected to many
2323
slaves. Each slave has its unique address, which is used in the
2424
communication between master and the slave. I2C uses two pins, one is
2525
for data transmission (SDA), the other is for the clock (SCL). Master
2626
uses the SCL to inform slave of the upcoming data transmission, and the
27-
data is transmitted through SDA. The I2C example was named Wire in the
27+
data is transmitted through SDA. The I2C example was named "Wire" in the
2828
Arduino example.
2929

3030
Introduction
31-
------------
31+
~~~~~~~~~~~~
3232

3333
In the example "I2C - Send Data to Arduino Uno", Ameba, the I2C master, transmits data to the Arduino UNO, the I2C slave.
3434
As to this example, Ameba is the I2C master, and receives data from the Arduino UNO, which is the I2C slave.
3535

3636
Procedure
37-
---------
37+
~~~~~~~~~
3838

3939
- **Setting up Arduino Uno to be I2C Slave**
4040

41-
| First, select Arduino in the Arduino IDE in Tools -> Board -> Arduino Uno:
42-
| Open Examples -> Wire -> slave_sender
41+
| First, select Arduino in the Arduino IDE in "Tools" -> "Board" -> "Arduino Uno":
42+
| Open "Examples" -> "Wire" -> "slave_sender"
4343
4444
|image01|
4545

46-
Then click Sketch -> Upload to compile and upload the example to Arduino Uno.
46+
Then click "Sketch" -> "Upload" to compile and upload the example to Arduino Uno.
4747

4848
- **Setting up Ameba to be I2C Master**
4949

50-
| Next, open another window of Arduino IDE, make sure to choose your Ameba development board in the IDE: Tools -> Board
51-
| Open File -> Examples -> AmebaWire -> MasterReceiveData
50+
| Next, open another window of Arduino IDE, make sure to choose your Ameba development board in the IDE: "Tools" -> "Board"
51+
| Open "File" -> "Examples" -> "AmebaWire" -> "MasterReceiveData"
5252
5353
|image02|
5454

55-
Click Sketch -> Upload to compile and upload the example to Ameba.
55+
Click "Sketch" -> "Upload" to compile and upload the example to Ameba.
5656

5757
- **Wiring**
5858

@@ -66,16 +66,16 @@ Click “Sketch” -> “Upload” to compile and upload the example to Ameba.
6666
| Next, we will observe the data receive by Ameba in the Serial Monitor.
6767
| (Note: If you do not know which port the Ameba development board is
6868
connected to, please find it in the Device Manager of Windows first.
69-
Ameba is connected as mbed Serial Port. For example, if you find
69+
Ameba is connected as "mbed Serial Port". For example, if you find
7070
mbed Serial Port (COM15) means Ameba is connected to port COM15.)
7171
7272
|image04|
7373

74-
| We select the port in Tools -> Port -> COM15 (the port connected to Ameba)
75-
| Open the Arduino IDE window of the Ameba, go to Tools -> Serial Monitor to display the messages printed by Ameba.
74+
| We select the port in "Tools" -> "Port" -> "COM15" (the port connected to Ameba)
75+
| Open the Arduino IDE window of the Ameba, go to "Tools" -> "Serial Monitor" to display the messages printed by Ameba.
7676
| Press the reset button on Arduino Uno, Arduino Uno now waits for connection from I2C master.
7777
| Then press the reset button on Ameba, Ameba will start to receive
78-
messages from Arduino Uno. And you can see the hello message
78+
messages from Arduino Uno. And you can see the "hello" message
7979
printed every half second in serial monitor.
8080
| (NOTE: If the message does not show in the Serial Monitor of Ameba,
8181
please close and open the serial monitor again.)
@@ -88,10 +88,10 @@ Code Reference
8888
| You can find detailed information of this example in the documentation of Arduino:
8989
| https://www.arduino.cc/en/Tutorial/MasterReader
9090
91-
| First use Wire.begin()/Wire.begin(address) to join the I2C bus as a master or slave, in the Master case the address is not required.
91+
| First use ``Wire.begin()`` / ``Wire.begin(address)`` to join the I2C bus as a master or slave, in the Master case the address is not required.
9292
| https://www.arduino.cc/en/Reference/WireBegin
9393
94-
| Next, the Master uses Wire.requestFrom() to specify from which Slave to request data.
94+
| Next, the Master uses ``Wire.requestFrom()`` to specify from which Slave to request data.
9595
| https://www.arduino.cc/en/Reference/WireRequestFrom
9696
9797
.. |image01| image:: ../../../_static/amebapro2/Example_Guides/I2C/Master_Receive_Data_from_Arduino_UNO/image01.png

source/amebapro2/Example_Guides/I2C/Master Send Data to Arduino UNO.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ Materials
1212

1313
- Arduino UNO x 1
1414

15-
1615
Example
1716
-------
1817

19-
Introduction of I2C
20-
-------------------
18+
I2C Introduction
19+
~~~~~~~~~~~~~~~~
2120

22-
There are two roles in the operation of I2C, one is master, the other
23-
is slave. Only one master is allowed and can be connected to many
21+
There are two roles in the operation of I2C, one is "master", the other
22+
is "slave". Only one master is allowed and can be connected to many
2423
slaves. Each slave has its unique address, which is used in the
2524
communication between master and the slave. I2C uses two pins, one is
2625
for data transmission (SDA), the other is for the clock (SCL). Master
2726
uses the SCL to inform slave of the upcoming data transmission, and the
28-
data is transmitted through SDA. The I2C example was named Wire in the
27+
data is transmitted through SDA. The I2C example was named "Wire" in the
2928
Arduino example.
3029

3130
Introduction
32-
------------
31+
~~~~~~~~~~~~
3332

3433
In this example, we use Ameba as the I2C master writer, and use Arduino
3534
as the I2C slave receiver.
@@ -38,21 +37,21 @@ When the I2C slave receives string sent from I2C master, it prints the
3837
received string.
3938

4039
Procedure
41-
---------
40+
~~~~~~~~~
4241

4342
- **Setting up Arduino Uno to be I2C Slave**
4443

45-
| First, select Arduino in the Arduino IDE in Tools -> Board -> Arduino Uno
46-
| Open the Slave Receiver example in Examples -> Wire -> slave_receiver:
44+
| First, select Arduino in the Arduino IDE in "Tools" -> "Board" -> "Arduino Uno"
45+
| Open the "Slave Receiver" example in "Examples" -> "Wire" -> "slave_receiver":
4746
4847
|image01|
4948

50-
Then click Sketch -> Upload to compile and upload the example to Arduino Uno.
49+
Then click "Sketch" -> "Upload" to compile and upload the example to Arduino Uno.
5150

52-
- Setting up Ameba to be I2C Master
51+
- **Setting up Ameba to be I2C Master**
5352

54-
| Next, open another window of Arduino IDE, make sure to choose your Ameba development board in the IDE: Tools -> Board
55-
| Then open the Master Writer example in File -> Examples -> AmebaWire -> MasterSendData
53+
| Next, open another window of Arduino IDE, make sure to choose your Ameba development board in the IDE: "Tools" -> "Board"
54+
| Then open the "Master Writer" example in "File" -> "Examples" -> "AmebaWire" -> "MasterSendData"
5655
5756
|image02|
5857

@@ -65,7 +64,7 @@ Then click “Sketch” -> “Upload” to compile and upload the example to Ard
6564

6665
|image03|
6766

68-
| Open the Arduino IDE of the Arduino Uno and open the serial monitor (Tools -> Serial Monitor).
67+
| Open the Arduino IDE of the Arduino Uno and open the serial monitor ("Tools" -> "Serial Monitor").
6968
| In the Serial Monitor, you can see the messages printed from Arduino Uno.
7069
| Next, press the reset button on Arduino Uno. Now the Arduino Uno is waiting for the connection from I2C Master.
7170
| We press the reset button on Ameba to start to send messages. Then observe the serial monitor, you can see the messages show up every half second.
@@ -78,13 +77,13 @@ Code Reference
7877
| You can find detailed information of this example in the documentation of Arduino:
7978
| https://www.arduino.cc/en/Tutorial/MasterWriter
8079
81-
| First use Wire.begin()/Wire.begin(address) to join the I2C bus as a master or slave, in the Master case the address is not required.
80+
| First use ``Wire.begin()`` / ``Wire.begin(address)`` to join the I2C bus as a master or slave, in the Master case the address is not required.
8281
| https://www.arduino.cc/en/Reference/WireBegin
8382
84-
| Next, the Master uses Wire.beginTransmission(address) to begin a transmission to the I2C slave with the given address:
83+
| Next, the Master uses ``Wire.beginTransmission(address)`` to begin a transmission to the I2C slave with the given address:
8584
| https://www.arduino.cc/en/Reference/WireBeginTransmission
8685
87-
| Uses Wire.write() to send data, and finally use Wire.endTransmission() to end a transmission to a Slave and transmits the bytes that were queued:
86+
| Uses ``Wire.write()`` to send data, and finally use ``Wire.endTransmission()`` to end a transmission to a Slave and transmits the bytes that were queued:
8887
| https://www.arduino.cc/en/Reference/WireEndTransmission
8988
9089
.. |image01| image:: ../../../_static/amebapro2/Example_Guides/I2C/Master_Send_Data_to_Arduino_UNO/image01.png

source/amebapro2/Example_Guides/I2C/OLED Display.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
The example will showcase texts, shapes, and bitmap images on an OLED
2222
display using the I2C communication protocol alongside Adafruit
2323
libraries.
2424

2525
Procedure
26-
---------
26+
~~~~~~~~~
2727

2828
Connect the 0.96-inch OLED display to I2C_SDA and I2C_SCL of the board.
2929

3030
|image01|
3131

32-
Open the example in File -> Examples -> AmebaWire -> OLED_SSD1306.
32+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "OLED_SSD1306".
3333

3434
|image02|
3535

3636
For this example, we will be using 0x3D as the address.
3737

3838
|image03|
3939

40-
If the address doesnt work for you, you can run I2CScanner to find the
41-
OLED address by navigating to File -> Examples -> AmebaWire ->
42-
I2CScanner.
40+
If the address doesn't work for you, you can run I2CScanner to find the
41+
OLED address by navigating to "File" -> "Examples" -> "AmebaWire" ->
42+
"I2CScanner".
4343

4444
|image04|
4545

source/amebapro2/Example_Guides/I2C/Retrieve Data from VL53L0X IR sensor.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Example
1616
-------
1717

1818
Introduction
19-
------------
19+
~~~~~~~~~~~~
2020

2121
This example will illustrate how to retrieve the value of VL53L0X IR
2222
sensor and pass it to the AMB82-Mini board. VL53L0X Distance Sensor is a
@@ -29,17 +29,17 @@ has pretty low power consumption.
2929
| 2) Single.ino
3030
3131
Procedure
32-
---------
32+
~~~~~~~~~
3333

3434
Connect the VL53L0X IR sensor to I2C_SDA and I2C_SCL of the board as shown in the diagram below.
3535

3636
|image01|
3737

38-
Open the example in File -> Examples -> AmebaWire -> VL53L0X -> Continuous OR Single.
38+
Open the example in "File" -> "Examples" -> "AmebaWire" -> "VL53L0X" -> "Continuous" OR "Single".
3939

4040
|image02|
4141

42-
You will choose Single if you want to get single-shot range
42+
You will choose "Single" if you want to get single-shot range
4343
measurements from the VL53L0X sensor. The sensor can be optionally be
4444
configured with different ranging profiles to get better performance for
4545
a certain application.

0 commit comments

Comments
 (0)