Skip to content

Commit

Permalink
work on string; far from completed
Browse files Browse the repository at this point in the history
  • Loading branch information
wovo committed Feb 23, 2017
1 parent 4f10233 commit 8b79fbd
Show file tree
Hide file tree
Showing 49 changed files with 860 additions and 349 deletions.
15 changes: 13 additions & 2 deletions demo/arduino-uno/hd44780-shield/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,23 @@ int main( void ){
auto rs = target::pin_out( target::pins::d8 );
auto e = target::pin_out( target::pins::d9 );
auto bl = target::pin_out( target::pins::d10 );
auto lcd = hwlib::hd44780( rs, e, d, 2, 16 );

// select the LCD size.
// the shield has a 2 x 16 LCD
// auto lcd = hwlib::hd44780( rs, e, d, 1, 16 );
// auto lcd = hwlib::hd44780( rs, e, d, 2, 16 );
// auto lcd = hwlib::hd44780( rs, e, d, 4, 20 );
auto lcd = hwlib::hd44780( rs, e, d, 2, 40 );

bl.set( 0 );
hwlib::wait_ms( 500 );
bl.set( 1 );

lcd << "\fHello world!\nnice to meet you" << hwlib::flush;
lcd
<< "\fHello world! | this is only for a"
<< "\nnice to meet you | 40 col. display."
<< "\t0002line 3 ============X"
<< "\nline 4 ============X"
<< hwlib::flush;

}
2 changes: 2 additions & 0 deletions demo/arduino-uno/hd44780-shield/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ HEADERS :=
# other places to look for files for this project
SEARCH :=



# set RELATIVE to the next higher directory
# and defer to the appropriate Makefile.* there
RELATIVE := ..
Expand Down
1 change: 1 addition & 0 deletions demo/native/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#############################################################################

SUBDIRS += hello
SUBDIRS += string

BUILDDIRS = $(SUBDIRS:%=build-%)
CLEANDIRS = $(SUBDIRS:%=clean-%)
Expand Down
25 changes: 25 additions & 0 deletions demo/native/string/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ==========================================================================
//
// hwlib::string demo
//
// (c) Wouter van Ooijen (wouter@voti.nl) 2017
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// ==========================================================================

#include "hwlib.hpp"
#include <iostream>

int main( void ){
hwlib::string< 100 > t = "Hello brave new world!\n";
std::cout << t;

auto r = t.range_start_end( 2, 5 );
hwlib::string< 100 > rr = r;
std::cout << "[" << rr << "]\n";

std::cout << "[" << t.range_start_length( 3, 9 ) << "]\n";
}
25 changes: 25 additions & 0 deletions demo/native/string/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#============================================================================
#
# simple project makefile (just a main file)
#
# (c) Wouter van Ooijen (wouter@voti.nl) 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#============================================================================

# source files in this project (main.* is automatically assumed)
SOURCES :=

# header files in this project
HEADERS :=

# other places to look for files for this project
SEARCH :=

# set RELATIVE to the next higher directory
# and defer to the appropriate Makefile.* there
RELATIVE := ..
include $(RELATIVE)/makefile.link
257 changes: 0 additions & 257 deletions include/hwlib-string.hpp

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions include/hwlib-demo.hpp → library/hwlib-demo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "hwlib-pin.hpp"
#include "hwlib-port.hpp"
#include "hwlib-adc.hpp"
#include "hwlib-dac.hpp"
#include "hwlib-wait.hpp"
#include "hwlib-graphics.hpp"

Expand Down
Loading

0 comments on commit 8b79fbd

Please sign in to comment.