Skip to content

as requested by fourstix #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/example10_turn_off_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 10: Turn Off Display')
Expand Down
3 changes: 1 addition & 2 deletions examples/example11_text_direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 11: Text Direction')
Expand Down
3 changes: 1 addition & 2 deletions examples/example12_display_input_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 12: Display Input Text')
Expand Down
3 changes: 1 addition & 2 deletions examples/example13_fast_backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 13: Fast Backlight')
Expand Down
3 changes: 1 addition & 2 deletions examples/example14_show_firmware_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 12: Show Firmware Version')
Expand Down
3 changes: 1 addition & 2 deletions examples/example15_system_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Press Ctrl-C to end program.')
Expand Down
3 changes: 1 addition & 2 deletions examples/example16_splash_screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
and save that as the splash screen.
"""
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 16: Splash Screen')
Expand Down
3 changes: 1 addition & 2 deletions examples/example1_hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
"""
from time import sleep
import board
import busio

# Enable I2C communication
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

# Enable SPI communication
Expand Down
3 changes: 1 addition & 2 deletions examples/example2_backlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print("Example 2: Backlight.")
Expand Down
3 changes: 1 addition & 2 deletions examples/example3_cursor_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
import time
import random
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

# These constants match a 16x2 SerLCD display
Expand Down
3 changes: 1 addition & 2 deletions examples/example4_move_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 4: Move Cursor')
Expand Down
3 changes: 1 addition & 2 deletions examples/example5_enable_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 5: Enable Cursor')
Expand Down
3 changes: 1 addition & 2 deletions examples/example6_blink_cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 6: Blink Cursor')
Expand Down
3 changes: 1 addition & 2 deletions examples/example7_scroll_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 7: Scroll Display')
Expand Down
3 changes: 1 addition & 2 deletions examples/example8_autoscroll_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

print('Example 8: Autoscroll Text')
Expand Down
3 changes: 1 addition & 2 deletions examples/example9_custom_characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
"""
from time import sleep
import board
import busio
from sparkfun_serlcd import Sparkfun_SerLCD_I2C

i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

# Define some custom characters as 8 x 5 bitmap arrays
Expand Down
3 changes: 1 addition & 2 deletions examples/serlcd_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
This program writes Hello, World! to the display.
"""
import board
import busio

# Enable I2C (Qwiic) communication
from sparkfun_serlcd import Sparkfun_SerLCD_I2C
i2c = busio.I2C(board.SCL, board.SDA)
i2c = board.I2C()
serlcd = Sparkfun_SerLCD_I2C(i2c)

# Enable SPI communication
Expand Down
8 changes: 4 additions & 4 deletions sparkfun_serlcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
__repo__ = "https://github.com/fourstix/Sparkfun_CircuitPython_SerLCD.git"

# imports
// from abc import ABC, abstractmethod // Please no abstractmethods, CircuitPython is not Python 3
# from abc import ABC, abstractmethod // Please no abstractmethods, CircuitPython is not Python 3
from time import sleep
from micropython import const

# public constants
# DEFAULT_I2C_ADDR = const(0x72)
DEFAULT_I2C_ADDR = const(0x72)
"""Default I2C address for SerLCD"""


Expand Down Expand Up @@ -442,11 +442,11 @@ def default_splash_screen(self):

# abstract methods

@abstractmethod
# @abstractmethod
def _write_bytes(self, data):
pass

@abstractmethod
# @abstractmethod
def _change_i2c_address(self, addr):
pass

Expand Down