Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Compile with: g++ `pkg-config --cflags --libs rpi-hw` display_ctl.cpp -o display_ctl
- // Include Rpi-hw headers
- #include <rpi-hw.hpp>
- #include <rpi-hw/time.hpp>
- #include <rpi-hw/iface/decoder-out.hpp>
- #include <rpi-hw/display/m7seg.hpp>
- // Use Rpi-hw namespace
- using namespace rpihw;
- int
- main( int argc, char *args[] ) {
- // Multiple seven-segment display controller
- display::m7seg dev( 1, 4, 18, 15, 14, 0, 17, 23 );
- // Create the enabler interface
- iface::decoderOut enabler( { 21, 22 } );
- // Set the number of displays and the enabler interface
- dev.setDisplays( 2, enabler );
- // Set the updating frequency (Hz)
- dev.setFreq( 60.0 );
- // Read new values from the stdin
- float tmp;
- while ( std::cin >> tmp )
- dev.set( tmp );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement