Skip to content

Commit ea6412d

Browse files
committed
fixed little typo. Added number of iterations parameter and changed forever parameter to be a switch
1 parent c8da244 commit ea6412d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ScrollpHat.psm1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ function Write-PhatString {
4545
[parameter(ValueFromPipeline=$True)]
4646
[string]$text,
4747
[int]$WaitMiliseconds = 40,
48-
[System.Boolean]$forever = $false
48+
[System.Management.Automation.SwitchParameter]$forever,
49+
[int]$iterations = 0
4950
)
5051
Set-PhatLedsOff
51-
if($forever)
52+
if($forever -OR $iterations > 0)
5253
{
5354
$text +=" "
5455
}
55-
$iterations = 0
5656
do
5757
{
5858
for($i =0; $i -lt $text.Length ; ++$i)
@@ -67,9 +67,9 @@ function Write-PhatString {
6767
Update-PhatRegisters
6868
Start-Sleep -Milliseconds $WaitMiliseconds
6969
}
70-
# $iterations +=1
70+
$iterations -=1
7171
# Write-Host $iterations
72-
}while($forever)
72+
}while($iterations -lt 0 -OR $forever)
7373
}
7474

7575
function Write-PhatChar {
@@ -233,6 +233,7 @@ function Set-PhatCrazyLeds () {
233233
# }
234234

235235
Select-ScrollpHat
236+
Set-PhatBrightness -Intensity Lowest
236237

237238
# Export only the functions using PowerShell standard verb-noun naming.
238239
# Be sure to list each exported functions in the FunctionsToExport field of the module manifest file.

simple_Setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Set-I2CRegister -Device $Device -Register $ConfigurationRegisterAddress -Data $C
1717
# x x
1818

1919
$registers = 0x01..0x3
20-
$letterA = 0x3E, 0x05, 0x3E
20+
$letterA = 0x1E, 0x05, 0x1E
2121

2222
$index = 0
2323
#Set the value on $letterA array on the correspondent register.

0 commit comments

Comments
 (0)