https://miosix.org/wiki/index.php?title=Example:_HD44780&feed=atom&action=historyExample: HD44780 - Revision history2024-03-28T12:41:57ZRevision history for this page on the wikiMediaWiki 1.39.6https://miosix.org/wiki/index.php?title=Example:_HD44780&diff=115&oldid=prevFede.tft: Created page with "=== HD44780 Example === This example file can be found in ''miosix/_examples/hd44780/hd44780.cpp'' <source lang="cpp"> #include <miosix.h> #include <util/lcd44780.h> using n..."2014-04-25T11:10:03Z<p>Created page with "=== HD44780 Example === This example file can be found in ''miosix/_examples/hd44780/hd44780.cpp'' <source lang="cpp"> #include <miosix.h> #include <util/lcd44780.h> using n..."</p>
<p><b>New page</b></p><div>=== HD44780 Example ===<br />
This example file can be found in ''miosix/_examples/hd44780/hd44780.cpp''<br />
<source lang="cpp"><br />
<br />
#include <miosix.h><br />
#include <util/lcd44780.h><br />
<br />
using namespace miosix;<br />
<br />
#ifndef _BOARD_STM32F4DISCOVERY<br />
#warning "You may need to choose different GPIOs that are free in your board"<br />
#endif<br />
<br />
typedef Gpio<GPIOB_BASE,12> d4;<br />
typedef Gpio<GPIOB_BASE,13> d5;<br />
typedef Gpio<GPIOB_BASE,14> d6;<br />
typedef Gpio<GPIOB_BASE,15> d7;<br />
typedef Gpio<GPIOC_BASE,1> rs;<br />
typedef Gpio<GPIOC_BASE,2> e;<br />
<br />
int main()<br />
{<br />
//First 6 parameters are GPIOs, then there are the number of lines<br />
//of the display, and number of characters per line<br />
Lcd44780 display(rs::getPin(),e::getPin(),d4::getPin(),<br />
d5::getPin(),d6::getPin(),d7::getPin(),2,16);<br />
display.clear();<br />
display.go(0,0);<br />
display.printf("Miosix + HD44780");<br />
for(int i=0;;i++)<br />
{<br />
Thread::sleep(1000);<br />
display.go(0,1);<br />
display.printf("i=%04d",i);<br />
}<br />
}<br />
</source><br />
<br />
[[Category:Examples]]</div>Fede.tft