Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
87b5e7c1
Commit
87b5e7c1
authored
11 years ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Added hd44780 example
parent
0fb80132
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miosix/_examples/hd44780/hd44780.cpp
+33
-0
33 additions, 0 deletions
miosix/_examples/hd44780/hd44780.cpp
with
33 additions
and
0 deletions
miosix/_examples/hd44780/hd44780.cpp
0 → 100644
+
33
−
0
View file @
87b5e7c1
#include
<miosix.h>
#include
<util/lcd44780.h>
using
namespace
miosix
;
#ifndef _BOARD_STM32F4DISCOVERY
#warning "You may need to choose different GPIOs that are free in your board"
#endif
typedef
Gpio
<
GPIOB_BASE
,
12
>
d4
;
typedef
Gpio
<
GPIOB_BASE
,
13
>
d5
;
typedef
Gpio
<
GPIOB_BASE
,
14
>
d6
;
typedef
Gpio
<
GPIOB_BASE
,
15
>
d7
;
typedef
Gpio
<
GPIOC_BASE
,
1
>
rs
;
typedef
Gpio
<
GPIOC_BASE
,
2
>
e
;
int
main
()
{
//First 6 parameters are GPIOs, then there are the number of lines
//of the display, and number of characters per line
Lcd44780
display
(
rs
::
getPin
(),
e
::
getPin
(),
d4
::
getPin
(),
d5
::
getPin
(),
d6
::
getPin
(),
d7
::
getPin
(),
2
,
16
);
display
.
clear
();
display
.
go
(
0
,
0
);
display
.
printf
(
"Miosix + HD44780"
);
for
(
int
i
=
0
;;
i
++
)
{
Thread
::
sleep
(
1000
);
display
.
go
(
0
,
1
);
display
.
printf
(
"i=%04d"
,
i
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment