@@ -44,23 +44,28 @@ function Write-String {
44
44
param (
45
45
[parameter (ValueFromPipeline = $True )]
46
46
[string ]$text ,
47
+ [int ]$WaitMiliseconds = 40 ,
47
48
[System.Boolean ]$forever = $false
48
49
)
49
50
Set-LedsOff
51
+ $iterations = 0
52
+ Write-Host " Before While"
50
53
do
51
54
{
52
55
for ($i = 0 ; $i -lt $text.Length ; ++ $i )
53
56
{
54
57
Write-Char $text [$i ]
55
58
# After Writing the char, make sure to leave a space.
56
-
59
+ # Write-Host "Wrote char $($text[$i])"
57
60
if ($Script :CurrentRegisterValues.Count -lt $Script :TotalRegisters ){ # We can still set an white column
58
61
$Script :CurrentRegisterValues += 0
59
62
Set-I2CRegister - Device $Script :Device - Register $Script :CurrentRegisterValues.Count - Data 0
60
63
}
61
64
Update-Registers
62
- Start-Sleep - Milliseconds 10
65
+ Start-Sleep - Milliseconds $WaitMiliseconds
63
66
}
67
+ # $iterations +=1
68
+ # Write-Host $iterations
64
69
}while ($forever )
65
70
}
66
71
@@ -84,12 +89,19 @@ function Write-Char {
84
89
K = 0x1F , 0x04 , 0x1B
85
90
L = 0x1F , 0x10 , 0x10
86
91
M = 0x1F , 0x02 , 0x04 , 0x02 , 0x1F
87
- N = 0x1F , 0x02 , 0x0C , 0x1F
92
+ N = 0x1F , 0x02 , 0x0C , 0x1F
88
93
O = 0x0E , 0x11 , 0x0E
89
94
P = 0x1F , 0x09 , 0x06
90
- Q = 0x0E , 0x11 , 0x09 , 0x16
95
+ Q = 0x0E , 0x11 , 0x09 , 0x16
91
96
R = 0x1F , 0x09 , 0x16
92
97
S = 0x12 , 0x15 , 0x09
98
+ T = 0x01 , 0x1F , 0x01
99
+ U = 0x0F , 0x10 , 0x10 , 0x0F
100
+ V = 0x0F , 0x10 , 0x0F
101
+ W = 0x0F , 0x10 , 0x08 , 0x10 , 0x0F
102
+ X = 0x1D , 0x04 , 0x1D
103
+ Y = 0x03 , 0x1C , 0x03
104
+ Z = 0x19 , 0x15 , 0x13
93
105
" 1" = 0x12 , 0x1F , 0x10
94
106
" 2" = 0x19 , 0x15 , 0x12
95
107
" 3" = 0x11 , 0x15 , 0x0A
@@ -101,6 +113,7 @@ function Write-Char {
101
113
" 9" = 0x02 , 0x15 , 0x0E
102
114
" 0" = 0x0E , 0x15 , 0x0E
103
115
" !" = 0x17
116
+ " " = 0X00 , 0X00
104
117
}
105
118
# ##################################
106
119
# get respective bits from hashtable
@@ -122,22 +135,24 @@ function Write-Char {
122
135
for ($j = 1 ; $j -le 10 ; ++ $j ) # 10 because we will leave the 11 to the new value
123
136
{
124
137
Set-I2CRegister - Device $Script :Device - Register $j - Data $Script :CurrentRegisterValues [$j - 1 ]
138
+ Update-Registers
125
139
}
126
140
141
+
127
142
# start by writing a white column
128
143
if ($wroteWhiteSpace -eq $false )
129
144
{
130
145
Set-I2CRegister - Device $Script :Device - Register 0xB - Data 0
131
146
$Script :CurrentRegisterValues += 0
132
- Update-Registers
147
+ # Update-Registers
133
148
$wroteWhiteSpace = $true
134
149
continue
135
150
}
136
151
137
152
Set-I2CRegister - Device $Script :Device - Register 0xB - Data $bitsArray [$i ]
138
153
$Script :CurrentRegisterValues += $bitsArray [$i ++ ]
139
154
Update-Registers
140
- # Start-Sleep -Milliseconds 200
155
+ Start-Sleep - Milliseconds 5
141
156
}
142
157
return
143
158
}
0 commit comments