当前位置: 首页>>代码示例>>C++>>正文


C++ Display::DisplayLeds方法代码示例

本文整理汇总了C++中Display::DisplayLeds方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::DisplayLeds方法的具体用法?C++ Display::DisplayLeds怎么用?C++ Display::DisplayLeds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Display的用法示例。


在下文中一共展示了Display::DisplayLeds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HandleGettingStringsMatchPatternState

// Get the string match pattern
uint32_t ReverseChordFinderMode::HandleGettingStringsMatchPatternState(uint32_t irKey)
{
    // Cache some useful data.
    Display *pDisplay = Display::Instance();
    uint8_t *pPattern = m_Chord.GetPatternPtr();
        
    // Assume that we're going to use the specified IR key.
    uint32_t returnKey = 0;
    
    switch (irKey)
    {
    case PATTERN_RIGHT: // Remove upper strings
        if (m_MatchPattern > 1)
        {
            m_MatchPattern >>= 1;
        }
        pPattern[0] = m_MatchPattern;
        
        // Display the match pattern on the fingerboard.
        pDisplay->DisplayLeds(&m_Chord);
        break;
        
    case PATTERN_LEFT: // Add upper strings.
        if (m_MatchPattern < ((1 << LedDriver::NUM_STRINGS) - 1))
        {
            m_MatchPattern = (m_MatchPattern <<= 1) + 1;
        }
        pPattern[0] = m_MatchPattern;

        // Display the match pattern on the fingerboard.
        pDisplay->DisplayLeds(&m_Chord);
        break;
        
    case SELECT: // Select the current pattern.  Advance to the next state.
        m_CurrentState = GETTING_FRET_STATE;

        // Reset the match pattern on the fingerboard.
        pPattern[0] = 0;
        pDisplay->DisplayLeds(&m_Chord);

        // Display our headline.
        m_Chord.SetFret(0);
        pDisplay->DispLcdProgmem(F("Base Fret: ANY"), true, 0, 0);
        break;
        
    default:
        // We didn't handle the passed in key, so return it unmodified.
        returnKey = irKey;
        break;
    }
开发者ID:regnaDkciN,项目名称:Guitar-Chord-Chart,代码行数:51,代码来源:ReverseChordFinderMode.cpp

示例2: Startup

// Get the Reverse Chord Finer mode ready to run.
void ReverseChordFinderMode::Startup()
{
    // Cache a pointer to the display instance.
    Display *pDisplay = Display::Instance();
    
    // Setup for the first state and initialize our instance daata.
    m_CurrentState  = GETTING_STRING_MATCH_PATTERN_STATE;
    m_CurrentString = 0;
    m_CurrentFret   = 0;
    m_CurrentValue  = 0;
    m_MatchPattern = (1 << LedDriver::NUM_STRINGS) - 1;
    memset(&m_Chord, 0, sizeof(Chord));
    
    // Reset our chord data to the first chord.
    m_ChordData.GetChord(0, 0, 0);
    
    // Clear all LEDs.
    pDisplay->SetAllLeds(false);
    
    // Display the initial match pattern on the fingerboard.
    uint8_t *pPattern = m_Chord.GetPatternPtr();
    pPattern[0] = m_MatchPattern;
    pDisplay->DisplayLeds(&m_Chord);
    
    pDisplay->DispLcdProgmem(F("Strings to Match"), true, 0, 0);
}
开发者ID:regnaDkciN,项目名称:Guitar-Chord-Chart,代码行数:27,代码来源:ReverseChordFinderMode.cpp


注:本文中的Display::DisplayLeds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。