Skip to content

Update SevenSegHW.cpp #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions hardware/zpuino/zpu/libraries/SevenSegHW/SevenSegHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ SEVENSEGHW::SEVENSEGHW()
{
}

void SEVENSEGHW::begin(int address)
{
this->nBaseAddress = address;
}

// Set the 4 digits Int value
void SEVENSEGHW::setIntValue(unsigned int value, unsigned int pos_dot)
{
Expand Down Expand Up @@ -100,8 +105,8 @@ void SEVENSEGHW::setHexValue(unsigned int value, unsigned int digit)
void SEVENSEGHW::setBrightness(unsigned int value)
{
//SEVSEGBRIGHT = (value << 4 )| getSegmentStatus();
//SEVSEGBRIGHT = (0xE000F);
SEVSEGBRIGHT = (0xF | (value<<16));
//SEVSEGBRIGHT = (0xE000F);
SEVSEGBRIGHT = (0xF | (value<<16));
}

// Get Brightness
Expand Down Expand Up @@ -132,6 +137,3 @@ unsigned int SEVENSEGHW::getSegmentStatus()
{
return SEVSEGBRIGHT & 0xF ;
}