Skip to content

Commit beba1e6

Browse files
authored
Merge pull request #5 from CleoQc/main
Fix typos in comments
2 parents 80d0b0c + bff100b commit beba1e6

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

qwiic_serlcd.py

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#==================================================================================
4646
#
4747
# This is mostly a port of existing Arduino functionaly, so pylint is sad.
48-
# The goal is to keep the public interface pthonic, but internal is internal
48+
# The goal is to keep the public interface pythonic, but internal is internal.
4949
#
5050
# pylint: disable=line-too-long, too-many-public-methods, invalid-name
5151
#
@@ -60,7 +60,7 @@
6060
[SparkFun 20x4 SerLCD - RGB Backlight (Qwiic)](https://www.sparkfun.com/products/16398)
6161
6262
This python package enables the user to control the SerLCDs via I2C.
63-
It is intended to be used by simply plugging in a qwiic cable for power and I2C communicaiton.
63+
It is intended to be used by simply plugging in a qwiic cable for power and I2C communication.
6464
6565
This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)
6666
@@ -82,7 +82,7 @@
8282
# The name of this device
8383
_DEFAULT_NAME = "SparkFun Qwiic SerLCD"
8484

85-
# Some devices have multiple availabel addresses - this is a list of these addresses.
85+
# Some devices have multiple available addresses - this is a list of these addresses.
8686
# NOTE: The first address in this list is considered the default I2C address for the
8787
# device.
8888
_AVAILABLE_I2C_ADDRESS = [0x72] # default address, note it can be changed via software commands
@@ -143,10 +143,10 @@ def map(x, in_min, in_max, out_min, out_max):
143143
:param in_max: maximum of input range
144144
:param out_min: minimum of output range
145145
:param out_max: maximum of output range
146-
146+
147147
:return: The value scaled to the new range
148148
:rtype: int
149-
"""
149+
"""
150150
return int((x-in_min) * (out_max-out_min) / (in_max-in_min) + out_min)
151151

152152
# define the class that encapsulates the device being created. All information associated with this
@@ -234,8 +234,8 @@ def print(self, string):
234234
Print a string of characters to the LCD
235235
236236
:param string: The string you would like to print. Aka ASCII characters. example: "Hello"
237-
238-
:return: Returns true if the I2C writes were successful, otherwise False.
237+
238+
:return: Returns True if the I2C writes were successful, otherwise False.
239239
:rtype: bool
240240
241241
"""
@@ -253,7 +253,7 @@ def clearScreen(self):
253253
"""
254254
Sends the command to clear the screen
255255
256-
:return: Returns true if the I2C write was successful, otherwise False.
256+
:return: Returns True if the I2C write was successful, otherwise False.
257257
:rtype: bool
258258
259259
"""
@@ -270,10 +270,10 @@ def clearScreen(self):
270270
def home(self):
271271
"""
272272
Send the home command to the display. This returns the cursor
273-
to return to the beginning of the display, without clearing
273+
to the beginning of the display, without clearing
274274
the display.
275275
276-
:return: Returns true if the I2C write was successful, otherwise False.
276+
:return: Returns True if the I2C write was successful, otherwise False.
277277
:rtype: bool
278278
279279
"""
@@ -291,13 +291,13 @@ def setCursor(self, col, row):
291291
292292
:param col: The column postion (0-19)
293293
:param row: The row postion (0-3)
294-
295-
:return: Returns true if the I2C write was successful, otherwise False.
294+
295+
:return: Returns True if the I2C write was successful, otherwise False.
296296
:rtype: bool
297297
298-
"""
298+
"""
299299
row_offsets = [0x00, 0x40, 0x14, 0x54]
300-
300+
301301
# kepp variables in bounds
302302
row = max(0, row) # row cannot be less than 0
303303
row = min(row, (MAX_ROWS - 1)) # row cannot be greater than max rows
@@ -318,8 +318,8 @@ def setContrast(self, contrast):
318318
Set the contrast of the LCD screen (0-255)
319319
320320
:param contrast: The new contrast value (0-255)
321-
322-
:return: Returns true if the I2C write was successful, otherwise False.
321+
322+
:return: Returns True if the I2C write was successful, otherwise False.
323323
:rtype: bool
324324
325325
"""
@@ -332,8 +332,8 @@ def setContrast(self, contrast):
332332
# so we need our "block of bytes" to include
333333
# CONTRAST_COMMAND and contrast value
334334

335-
block = [CONTRAST_COMMAND, contrast]
336-
335+
block = [CONTRAST_COMMAND, contrast]
336+
337337
# send the complete bytes (address, settings command , contrast command, contrast value)
338338
result = self._i2c.writeBlock(self.address, SETTING_COMMAND, block)
339339
time.sleep(0.01)
@@ -351,8 +351,8 @@ def setBacklight(self, r, g, b):
351351
:param red: The new red brightness value (0-255)
352352
:param green: The new green brightness value (0-255)
353353
:param blue: The new blue brightness value (0-255)
354-
355-
:return: Returns true if the I2C write was successful, otherwise False.
354+
355+
:return: Returns True if the I2C write was successful, otherwise False.
356356
:rtype: bool
357357
358358
"""
@@ -384,12 +384,12 @@ def setBacklight(self, r, g, b):
384384
self._displayControl |= LCD_DISPLAYON
385385
block[8] = SPECIAL_COMMAND
386386
block[9] = (LCD_DISPLAYCONTROL | self._displayControl)
387-
387+
388388
# send the complete bytes (address, settings command , contrast command, contrast value)
389389
result = self._i2c.writeBlock(self.address, SETTING_COMMAND, block)
390390
time.sleep(0.05)
391391
return result
392-
392+
393393
# ----------------------------------
394394
# specialCommand()
395395
#
@@ -402,8 +402,8 @@ def specialCommand(self, command, count = 1):
402402
403403
:param command: Command to send (a single byte)
404404
:param count: Number of times to send the command (if ommited, then default is once)
405-
406-
:return: Returns true if the I2C write was successful, otherwise False.
405+
406+
:return: Returns True if the I2C write was successful, otherwise False.
407407
:rtype: bool
408408
409409
"""
@@ -412,7 +412,7 @@ def specialCommand(self, command, count = 1):
412412
result = self._i2c.writeByte(self.address, SPECIAL_COMMAND, command)
413413
time.sleep(0.05)
414414
return result
415-
415+
416416
# ----------------------------------
417417
# command()
418418
#
@@ -425,7 +425,7 @@ def command(self, command):
425425
426426
:param command: Command to send (a single byte)
427427
428-
:return: Returns true if the I2C write was successful, otherwise False.
428+
:return: Returns True if the I2C write was successful, otherwise False.
429429
:rtype: bool
430430
431431
"""
@@ -443,7 +443,7 @@ def moveCursorLeft(self, count = 1):
443443
444444
:param count: Number of character spaces you'd like to move
445445
446-
:return: Returns true if the I2C write was successful, otherwise False.
446+
:return: Returns True if the I2C write was successful, otherwise False.
447447
:rtype: bool
448448
449449
"""
@@ -459,7 +459,7 @@ def moveCursorRight(self, count = 1):
459459
460460
:param count: Number of character spaces you'd like to move
461461
462-
:return: Returns true if the I2C write was successful, otherwise False.
462+
:return: Returns True if the I2C write was successful, otherwise False.
463463
:rtype: bool
464464
465465
"""
@@ -473,7 +473,7 @@ def cursor(self):
473473
"""
474474
Turn the underline cursor on.
475475
476-
:return: Returns true if the I2C write was successful, otherwise False.
476+
:return: Returns True if the I2C write was successful, otherwise False.
477477
:rtype: bool
478478
479479
"""
@@ -488,7 +488,7 @@ def noCursor(self):
488488
"""
489489
Turn the underline cursor off.
490490
491-
:return: Returns true if the I2C write was successful, otherwise False.
491+
:return: Returns True if the I2C write was successful, otherwise False.
492492
:rtype: bool
493493
494494
"""
@@ -503,7 +503,7 @@ def blink(self):
503503
"""
504504
Turn the blink cursor on.
505505
506-
:return: Returns true if the I2C write was successful, otherwise False.
506+
:return: Returns True if the I2C write was successful, otherwise False.
507507
:rtype: bool
508508
509509
"""
@@ -518,7 +518,7 @@ def noBlink(self):
518518
"""
519519
Turn the blink cursor off.
520520
521-
:return: Returns true if the I2C write was successful, otherwise False.
521+
:return: Returns True if the I2C write was successful, otherwise False.
522522
:rtype: bool
523523
524524
"""
@@ -535,7 +535,7 @@ def scrollDisplayLeft(self, count = 1):
535535
536536
:param count: Number of character spaces you'd like to scroll
537537
538-
:return: Returns true if the I2C write was successful, otherwise False.
538+
:return: Returns True if the I2C write was successful, otherwise False.
539539
:rtype: bool
540540
541541
"""
@@ -551,7 +551,7 @@ def scrollDisplayRight(self, count = 1):
551551
552552
:param count: Number of character spaces you'd like to scroll
553553
554-
:return: Returns true if the I2C write was successful, otherwise False.
554+
:return: Returns True if the I2C write was successful, otherwise False.
555555
:rtype: bool
556556
557557
"""
@@ -565,7 +565,7 @@ def autoscroll(self):
565565
"""
566566
Turn autoscrolling on. This will right-justify text from the cursor.
567567
568-
:return: Returns true if the I2C write was successful, otherwise False.
568+
:return: Returns True if the I2C write was successful, otherwise False.
569569
:rtype: bool
570570
571571
"""
@@ -580,7 +580,7 @@ def noAutoscroll(self):
580580
"""
581581
Turn autoscrolling off.
582582
583-
:return: Returns true if the I2C write was successful, otherwise False.
583+
:return: Returns True if the I2C write was successful, otherwise False.
584584
:rtype: bool
585585
586586
"""
@@ -596,7 +596,7 @@ def leftToRight(self):
596596
"""
597597
Set the text to flow from left to right.
598598
599-
:return: Returns true if the I2C write was successful, otherwise False.
599+
:return: Returns True if the I2C write was successful, otherwise False.
600600
:rtype: bool
601601
602602
"""
@@ -611,7 +611,7 @@ def rightToLeft(self):
611611
"""
612612
Set the text to flow from right to left
613613
614-
:return: Returns true if the I2C write was successful, otherwise False.
614+
:return: Returns True if the I2C write was successful, otherwise False.
615615
:rtype: bool
616616
617617
"""
@@ -630,7 +630,7 @@ def createChar(self, location, charmap):
630630
:param location: character number 0 to 7
631631
:param charmap: byte array for character
632632
633-
:return: Returns true if the I2C write was successful, otherwise False.
633+
:return: Returns True if the I2C write was successful, otherwise False.
634634
:rtype: bool
635635
636636
"""
@@ -661,7 +661,7 @@ def writeChar(self, location):
661661
Write a customer character to the display
662662
:param location: character number 0 to 7
663663
664-
:return: Returns true if the I2C write was successful, otherwise False.
664+
:return: Returns True if the I2C write was successful, otherwise False.
665665
:rtype: bool
666666
667667
"""
@@ -680,7 +680,7 @@ def display(self):
680680
"""
681681
Turn the display on quickly.
682682
683-
:return: Returns true if the I2C write was successful, otherwise False.
683+
:return: Returns True if the I2C write was successful, otherwise False.
684684
:rtype: bool
685685
686686
"""
@@ -695,7 +695,7 @@ def noDisplay(self):
695695
"""
696696
Turn the display off quickly.
697697
698-
:return: Returns true if the I2C write was successful, otherwise False.
698+
:return: Returns True if the I2C write was successful, otherwise False.
699699
:rtype: bool
700700
701701
"""
@@ -716,7 +716,7 @@ def setFastBacklight(self, r, g, b):
716716
:param g: green backlight value 0-255
717717
:param b: blue backlight value 0-255
718718
719-
:return: Returns true if the I2C write was successful, otherwise False.
719+
:return: Returns True if the I2C write was successful, otherwise False.
720720
:rtype: bool
721721
722722
"""
@@ -744,7 +744,7 @@ def enableSystemMessages(self):
744744
"""
745745
Enable system messages
746746
747-
:return: Returns true if the I2C write was successful, otherwise False.
747+
:return: Returns True if the I2C write was successful, otherwise False.
748748
:rtype: bool
749749
750750
"""
@@ -763,7 +763,7 @@ def disableSystemMessages(self):
763763
"""
764764
Disable system messages
765765
766-
:return: Returns true if the I2C write was successful, otherwise False.
766+
:return: Returns True if the I2C write was successful, otherwise False.
767767
:rtype: bool
768768
769769
"""
@@ -781,7 +781,7 @@ def enableSplash(self):
781781
"""
782782
Enable splash screen at power on
783783
784-
:return: Returns true if the I2C write was successful, otherwise False.
784+
:return: Returns True if the I2C write was successful, otherwise False.
785785
:rtype: bool
786786
787787
"""
@@ -799,7 +799,7 @@ def disableSplash(self):
799799
"""
800800
Disable splash screen at power on
801801
802-
:return: Returns true if the I2C write was successful, otherwise False.
802+
:return: Returns True if the I2C write was successful, otherwise False.
803803
:rtype: bool
804804
805805
"""
@@ -821,7 +821,7 @@ def saveSplash(self):
821821
Saves whatever is currently being displayed into EEPROM
822822
This will be displayed at next power on as the splash screen
823823
824-
:return: Returns true if the I2C write was successful, otherwise False.
824+
:return: Returns True if the I2C write was successful, otherwise False.
825825
:rtype: bool
826826
827827
"""
@@ -848,7 +848,7 @@ def setAddress(self, new_addr):
848848
to unbrick the display.
849849
:param new_addr: new i2c address
850850
851-
:return: Returns true if the I2C write was successful, otherwise False.
851+
:return: Returns True if the I2C write was successful, otherwise False.
852852
:rtype: bool
853853
854854
"""

0 commit comments

Comments
 (0)