Skip to content

Commit d87e279

Browse files
committed
as requested by fourstix
modifications suggested by me to @fourstix
1 parent ba6a131 commit d87e279

18 files changed

+21
-38
lines changed

examples/example10_turn_off_display.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
"""
2020
from time import sleep
2121
import board
22-
import busio
2322
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2423

25-
i2c = busio.I2C(board.SCL, board.SDA)
24+
i2c = board.I2C()
2625
serlcd = Sparkfun_SerLCD_I2C(i2c)
2726

2827
print('Example 10: Turn Off Display')

examples/example11_text_direction.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 11: Text Direction')

examples/example12_display_input_text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 12: Display Input Text')

examples/example13_fast_backlight.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 13: Fast Backlight')

examples/example14_show_firmware_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"""
1818
from time import sleep
1919
import board
20-
import busio
2120
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2221

23-
i2c = busio.I2C(board.SCL, board.SDA)
22+
i2c = board.I2C()
2423
serlcd = Sparkfun_SerLCD_I2C(i2c)
2524

2625
print('Example 12: Show Firmware Version')

examples/example15_system_messages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
"""
2424
from time import sleep
2525
import board
26-
import busio
2726
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2827

29-
i2c = busio.I2C(board.SCL, board.SDA)
28+
i2c = board.I2C()
3029
serlcd = Sparkfun_SerLCD_I2C(i2c)
3130

3231
print('Press Ctrl-C to end program.')

examples/example16_splash_screen.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
and save that as the splash screen.
2121
"""
2222
import board
23-
import busio
2423
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2524

26-
i2c = busio.I2C(board.SCL, board.SDA)
25+
i2c = board.I2C()
2726
serlcd = Sparkfun_SerLCD_I2C(i2c)
2827

2928
print('Example 16: Splash Screen')

examples/example1_hello_world.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221

2322
# Enable I2C communication
2423
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2524

26-
i2c = busio.I2C(board.SCL, board.SDA)
25+
i2c = board.I2C()
2726
serlcd = Sparkfun_SerLCD_I2C(i2c)
2827

2928
# Enable SPI communication

examples/example2_backlight.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020
"""
2121
from time import sleep
2222
import board
23-
import busio
2423
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2524

26-
i2c = busio.I2C(board.SCL, board.SDA)
25+
i2c = board.I2C()
2726
serlcd = Sparkfun_SerLCD_I2C(i2c)
2827

2928
print("Example 2: Backlight.")

examples/example3_cursor_position.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
import time
2020
import random
2121
import board
22-
import busio
2322
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2423

25-
i2c = busio.I2C(board.SCL, board.SDA)
24+
i2c = board.I2C()
2625
serlcd = Sparkfun_SerLCD_I2C(i2c)
2726

2827
# These constants match a 16x2 SerLCD display

examples/example4_move_cursor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"""
1818
from time import sleep
1919
import board
20-
import busio
2120
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2221

23-
i2c = busio.I2C(board.SCL, board.SDA)
22+
i2c = board.I2C()
2423
serlcd = Sparkfun_SerLCD_I2C(i2c)
2524

2625
print('Example 4: Move Cursor')

examples/example5_enable_cursor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 5: Enable Cursor')

examples/example6_blink_cursor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
"""
1818
from time import sleep
1919
import board
20-
import busio
2120
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2221

23-
i2c = busio.I2C(board.SCL, board.SDA)
22+
i2c = board.I2C()
2423
serlcd = Sparkfun_SerLCD_I2C(i2c)
2524

2625
print('Example 6: Blink Cursor')

examples/example7_scroll_display.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 7: Scroll Display')

examples/example8_autoscroll_text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
"""
1919
from time import sleep
2020
import board
21-
import busio
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2322

24-
i2c = busio.I2C(board.SCL, board.SDA)
23+
i2c = board.I2C()
2524
serlcd = Sparkfun_SerLCD_I2C(i2c)
2625

2726
print('Example 8: Autoscroll Text')

examples/example9_custom_characters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
"""
2323
from time import sleep
2424
import board
25-
import busio
2625
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
2726

28-
i2c = busio.I2C(board.SCL, board.SDA)
27+
i2c = board.I2C()
2928
serlcd = Sparkfun_SerLCD_I2C(i2c)
3029

3130
# Define some custom characters as 8 x 5 bitmap arrays

examples/serlcd_simpletest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
This program writes Hello, World! to the display.
1717
"""
1818
import board
19-
import busio
2019

2120
# Enable I2C (Qwiic) communication
2221
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
23-
i2c = busio.I2C(board.SCL, board.SDA)
22+
i2c = board.I2C()
2423
serlcd = Sparkfun_SerLCD_I2C(i2c)
2524

2625
# Enable SPI communication

sparkfun_serlcd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060
__repo__ = "https://github.com/fourstix/Sparkfun_CircuitPython_SerLCD.git"
6161

6262
# imports
63-
// from abc import ABC, abstractmethod // Please no abstractmethods, CircuitPython is not Python 3
63+
# from abc import ABC, abstractmethod // Please no abstractmethods, CircuitPython is not Python 3
6464
from time import sleep
6565
from micropython import const
6666

6767
# public constants
68-
# DEFAULT_I2C_ADDR = const(0x72)
68+
DEFAULT_I2C_ADDR = const(0x72)
6969
"""Default I2C address for SerLCD"""
7070

7171

@@ -442,11 +442,11 @@ def default_splash_screen(self):
442442

443443
# abstract methods
444444

445-
@abstractmethod
445+
# @abstractmethod
446446
def _write_bytes(self, data):
447447
pass
448448

449-
@abstractmethod
449+
# @abstractmethod
450450
def _change_i2c_address(self, addr):
451451
pass
452452

0 commit comments

Comments
 (0)