Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
BlinkenLights
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UCC
BlinkenLights
Commits
b1038923
Commit
b1038923
authored
Nov 02, 2014
by
Mitchell Pomery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Squashed the weird garbled output bug
parent
f84b9d5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
BlinkenLights.ino
BlinkenLights.ino
+13
-7
No files found.
BlinkenLights.ino
View file @
b1038923
...
...
@@ -69,6 +69,10 @@ char hexToChar(char* c) {
return
(
char
)
strtol
(
c
,
NULL
,
16
);
}
char
cthret
[
3
];
// We return a pointer to a character below.
// If we don't have this, then the returned value can be overwritten before we
// read it.
char
*
charToHex
(
char
c
)
{
char
base_digits
[
16
]
=
{
...
...
@@ -85,28 +89,30 @@ char* charToHex(char c) {
index
++
;
}
index
--
;
// back up to last entry in the array
char
ret
[
3
];
int
i
=
0
;
if
(
index
<
0
)
{
ret
[
i
]
=
base_digits
[
0
];
cth
ret
[
i
]
=
base_digits
[
0
];
i
++
;
}
if
(
index
<
1
)
{
ret
[
i
]
=
base_digits
[
0
];
cth
ret
[
i
]
=
base_digits
[
0
];
i
++
;
}
for
(;
index
>=
0
&&
i
<
2
;
index
--
)
// go backward through array
{
ret
[
i
]
=
base_digits
[
converted_number
[
index
]];
cth
ret
[
i
]
=
base_digits
[
converted_number
[
index
]];
i
++
;
}
ret
[
2
]
=
'\0'
;
Serial
.
print
(
ret
);
// NEVER REMOVE THIS LINE. OR DIE
cth
ret
[
2
]
=
'\0'
;
//Serial.print(cth
ret); // NEVER REMOVE THIS LINE. OR DIE
// WITHOUT IT WE GET GARBLED OUTPUT HERE
// YOU HAVE BEEN WARNED
return
ret
;
// Fixed by adding cthret
return
cthret
;
}
// ============================ LIGHT MANIPULATION ============================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment