Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
herzi
project
bob3
libbob3
Commits
7786547e
Commit
7786547e
authored
Oct 12, 2018
by
Sebastian Neuser
Browse files
Add small example program
parent
4814c0d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
7786547e
*.o
/*.elf
/*.hex
example.cpp
0 → 100644
View file @
7786547e
#include
<BOB3.h>
void
setup
()
{
bob3
.
enableIRSensor
(
true
);
}
void
loop
()
{
int16_t
proximity
=
bob3
.
getIRSensor
();
int16_t
red
=
proximity
;
int16_t
green
=
15
-
proximity
;
green
=
green
<
0
?
0
:
green
;
uint16_t
color
=
rgb
(
red
,
green
,
0
);
bob3
.
setEyes
(
color
,
color
);
bob3
.
setWhiteLeds
(
bob3
.
getArm
(
1
),
bob3
.
getArm
(
2
));
}
Write
Preview
Supports
Markdown
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