Пример #1
0
void Reporting::reportText(Priority p, const char* text) {
    if (p == PRIORITY_DEBUG) {
      #ifdef DEBUG
        Display disp = Display();
        disp.drawText(0, 0, SMALL_FONT, text);
        disp.paint();
      #endif
    }
    else if (p == PRIORITY_PANIC) {
        Display disp = Display();
        disp.drawText(0, 0, SMALL_FONT, text);
        disp.paint();
    }
}
Пример #2
0
int main()
{
    Display myDisplay; //Creates Display Object called myDisplay
    
    //Function Examples
    //myDisplay.reset(); //Resets the function with blank spaces ' '
    
    //myDisplay.reset('b'); //Another reset function that initializes the array with a specified char;
    
    //myDisplay.drawLine(startingXPositionInt, startingYPositionInt, endingXPositionInt, endingYPositionInt);
    //or
    //myDisplay.drawLine(startingXPositionInt, startingYPositionInt, endingXPositionInt, endingYPositionInt, char);
    
    //myDisplay.drawRectangle( widthOfRectangleInt, heightOfRectangleInt, startingXPositionInt, startingYPositionInt);
    //or
    //myDisplay.drawRectangle( widthOfRectangleInt, heightOfRectangleInt, startingXPositionInt, startingYPositionInt, char);
    
    //myDisplay.drawText(startingXPositionInt, startingYPositionInt, endingXPositionInt, endingYPositionInt, string);
    
    //myDisplay.drawCircle(centerXPositionInt, centerYPositionInt, radiusInt);
    //or
    //myDisplay.drawCircle(centerXPositionInt, centerYPositionInt, radiusInt, char);
    
    myDisplay.reset(); //Resets the function with blank spaces ' '
    
    myDisplay.drawPixel(78, 73, '*');
    
    myDisplay.drawLine(0, 0, 0, 40); //Example Use of drawLine Function
    
    myDisplay.drawText(1, 5, 11, 5, "Hello World"); //Example Use of drawText Function (Includes drawTextDown)
    //Draws text between the given points whether horizontal or vertical
    //If the first point is lower than the second point text is reversed to be displayed backwards (Lower Level Ability)
    
    myDisplay.drawRectangle(6, 6, 20, 20, '&'); //Example Use of drawRectangle Function
    
    myDisplay.drawCircle(20,20,5); //Draws Circle
    
    myDisplay.displayScreen(); //Displays Screen on Command Line
    return 0;
}
Пример #3
0
void Reporting::reportCode(Priority p, VisualStateMethod method, uint32_t code) {
    if (method == LIGHTS) {
        if (p == PRIORITY_DEBUG) {
          #ifdef DEBUG
            srwp.stepLights = code;
            srwp.functionLights = 0xFFFF;
            ShiftRegisters::Instance().open(NULL);
            ShiftRegisters::Instance().write(&srwp);
            ShiftRegisters::Instance().close();
          #endif
        }
    }
    else {
        if (p == PRIORITY_DEBUG)  {
            #ifdef DEBUG
                Display disp = Display();
                char hexString[10];
                sprintf(hexString, "0x%X", (unsigned int)code);
                disp.drawText(0, 0, SMALL_FONT, hexString);
                disp.paint();
            #endif
        }
    }
}