fixed displays
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "OutputGPIOInterface.h"
|
||||
|
||||
#include "utility/config.h"
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace output
|
||||
@@ -158,13 +160,15 @@ void OutputGPIOInterface::write_display_digit(const uint8_t display_address, con
|
||||
select_display_digit(content);
|
||||
|
||||
run_display(display_address);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(DISPLAY_SLEEP_TIME_MILLISECONDS));
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::select_display_segment(const uint8_t &segment)
|
||||
{
|
||||
write_pin(pins_display.at("segment_select_A"), segment & 0b001u);
|
||||
write_pin(pins_display.at("segment_select_B"), segment & 0b010u);
|
||||
write_pin(pins_display.at("segment_select_C"), segment & 0b100u);
|
||||
write_pin(pins_display.at("segment_select_A"), segment & ~0b001u);
|
||||
write_pin(pins_display.at("segment_select_B"), segment & ~0b010u);
|
||||
write_pin(pins_display.at("segment_select_C"), segment & ~0b100u);
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::select_display_digit(const char &content)
|
||||
@@ -177,9 +181,19 @@ void OutputGPIOInterface::select_display_digit(const char &content)
|
||||
|
||||
void OutputGPIOInterface::run_display(const uint8_t &address)
|
||||
{
|
||||
write_pin(pins_display.at("display_select_" + std::to_string(address)), true);
|
||||
write_pin(pins_display.at("display_select_" + std::to_string(address)), 0);
|
||||
|
||||
write_pin(pins_display.at("display_select_" + std::to_string(address)), false);
|
||||
write_pin(pins_display.at("display_select_" + std::to_string(address)), 1);
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::activate_displays()
|
||||
{
|
||||
write_pin(pins_display.at("run"), 1);
|
||||
}
|
||||
|
||||
void OutputGPIOInterface::deactivate_displays()
|
||||
{
|
||||
write_pin(pins_display.at("run"), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ public:
|
||||
void deactivate(items::DriverBoardItem *driver_board_item) override;
|
||||
void deactivate(items::Item *sound) override;
|
||||
|
||||
void activate_displays();
|
||||
void deactivate_displays();
|
||||
void write_display(items::IDisplay &display) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -23,7 +23,6 @@ public:
|
||||
Item(std::move(output_gpio_interface), address, std::move(name)) {}
|
||||
~DriverBoardItem() override = default;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace flippR_driver
|
||||
{
|
||||
namespace utility
|
||||
{
|
||||
class InputSocketHandler : public SocketHandler, IEventHandler
|
||||
class InputSocketHandler : public SocketHandler, public IEventHandler
|
||||
{
|
||||
public:
|
||||
explicit InputSocketHandler(boost::asio::io_service &service, std::string socket_file = "/var/run/user/" + std::to_string(getuid())
|
||||
|
||||
5
FlippR-Driver/src/utility/OutputSocketHandler.cpp
Normal file
5
FlippR-Driver/src/utility/OutputSocketHandler.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
//
|
||||
// Created by rhetenor on 11.12.18.
|
||||
//
|
||||
|
||||
#include "OutputSocketHandler.h"
|
||||
21
FlippR-Driver/src/utility/OutputSocketHandler.h
Normal file
21
FlippR-Driver/src/utility/OutputSocketHandler.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// Created by rhetenor on 11.12.18.
|
||||
//
|
||||
|
||||
#ifndef FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
||||
#define FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
||||
|
||||
namespace flippR_driver
|
||||
{
|
||||
namespace utility
|
||||
{
|
||||
|
||||
class OutputSocketHandler : public SocketHandler
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif //FLIPPR_DRIVER_OUTPUTSOCKETHANDLER_H
|
||||
@@ -16,3 +16,5 @@
|
||||
#define INPUT_SLEEP_DURATION_NANO 800
|
||||
|
||||
#define PULLDOWN false
|
||||
|
||||
#define DISPLAY_SLEEP_TIME_MILLISECONDS 1
|
||||
|
||||
Reference in New Issue
Block a user