Skip to content

Commit 7a8adc3

Browse files
committed
Adding 7-bit I2C warning to example code. Added fast I2C example.
OpenSegment works at 400kHz! Neat!
1 parent 7db5c52 commit 7a8adc3

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_I2C_Basic/S7S_Example_I2C_Basic.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
1010
This is example code that shows how to send data over I2C to the display.
1111
12+
Please Note: 0x71 is the 7-bit I2C address. If you are using a different language than Arduino you will probably
13+
need to add the Read/Write bit to the end of the address. This means the default read address for the OpenSegment
14+
is 0b.1110.0011 or 0xE3 and the write address is 0b.1110.0010 or 0xE2.
15+
For more information see https://learn.sparkfun.com/tutorials/i2c
16+
1217
Note: This code expects the display to be listening at the default I2C address. If your display is not at 0x71, you can
1318
do a software or hardware reset. See the Wiki for more info:
1419
http://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands
@@ -18,6 +23,12 @@
1823
A4 to SDA
1924
VIN to PWR
2025
GND to GND
26+
27+
For this example pull up resistors are not needed on SDA and SCL. If you have other devices on the
28+
I2C bus then 4.7k pull up resistors are recommended.
29+
30+
OpenSegment will work at 400kHz Fast I2C. Use the .setClock() call shown below to set the data rate
31+
faster if needed.
2132
2233
*/
2334

@@ -31,6 +42,9 @@ void setup()
3142
{
3243
Wire.begin(); //Join the bus as master
3344

45+
//By default .begin() will set I2C SCL to Standard Speed mode of 100kHz
46+
//Wire.setClock(400000); //Optional - set I2C SCL to High Speed Mode of 400kHz
47+
3448
Serial.begin(9600); //Start serial communication at 9600 for debug statements
3549
Serial.println("OpenSegment Example Code");
3650

firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_I2C_Settings/S7S_Example_I2C_Settings.ino

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
Serial7Segment is an open source seven segment display.
99
1010
This is example code that shows how to control the brightness level of the display over I2C.
11+
12+
Please Note: 0x71 is the 7-bit I2C address. If you are using a different language than Arduino you will probably
13+
need to add the Read/Write bit to the end of the address. This means the default read address for the OpenSegment
14+
is 0b.1110.0011 or 0xE3 and the write address is 0b.1110.0010 or 0xE2.
15+
For more information see https://learn.sparkfun.com/tutorials/i2c
1116
1217
Note: This code expects the display to be listening at the default I2C address. If your display is not at 0x71, you can
1318
do a software or hardware reset. See the Wiki for more info:
@@ -19,6 +24,12 @@
1924
VIN to PWR
2025
GND to GND
2126
27+
For this example pull up resistors are not needed on SDA and SCL. If you have other devices on the
28+
I2C bus then 4.7k pull up resistors are recommended.
29+
30+
OpenSegment will work at 400kHz Fast I2C. Use the .setClock() call shown below to set the data rate
31+
faster if needed.
32+
2233
*/
2334

2435
#include <Wire.h>
@@ -29,6 +40,9 @@ void setup()
2940
{
3041
Wire.begin(); //Join the bus as master
3142

43+
//By default .begin() will set I2C SCL to Standard Speed mode of 100kHz
44+
//Wire.setClock(400000); //Optional - set I2C SCL to High Speed Mode of 400kHz
45+
3246
Serial.begin(9600); //Start serial communication at 9600 for debug statements
3347
Serial.println("OpenSegment Example Code");
3448

0 commit comments

Comments
 (0)