示例#1
0
void PrintMaze() {
    //OledClearBuffer();
    const int grid[]={27,30,44,47,70,73,107,110,127,
                      50,53,79,82,90,93,127,
                      20,23,67,70,106,109,127};
    OledMoveTo(0,0);OledDrawRect(127,31);
    uint32_t xc = 0;
    uint32_t yc = 7;
    uint32_t ind = 0;
    OledMoveTo(xc,yc);
    while(1) {
    OledLineTo(grid[ind],yc);
    if (grid[ind++]==127) {
    yc+=8;
    OledMoveTo(0,yc);
    if(yc>30) break; //we're done
    }
    else OledMoveTo(grid[ind++],yc);
    }
    OledMoveTo(64,0);
    OledLineTo(64,23);
    OledMoveTo(40,7);
    OledLineTo(40,15);
    OledMoveTo(85,7);
    OledLineTo(85,23);
    OledMoveTo(96,23);
    OledLineTo(96,31);
    OledUpdate();
}
示例#2
0
//the graph boundaries and lines are drawn
void setupGraph()
{
    int xco = 0;
    int yco = 0;

    //Solid boundaries drawn
    OledClearBuffer();
    OledMoveTo(0,0);
    OledLineTo(127,0);
    OledMoveTo(0,30);
    OledLineTo(127,30);
    OledMoveTo(0,0);
    OledLineTo(0,31);
    OledMoveTo(127,0);
    OledLineTo(127,31);


    //dashed boundaries drawn
    for (xco = 0; xco < 127; xco = xco+5)
    {
        OledMoveTo(xco,15);
        OledLineTo(xco+2,15);
    }

    for (xco = 40; xco < 121; xco = xco + 40)
    {
        OledMoveTo(xco,0);
        for (yco = 0; yco < 31; yco = yco + 5)
        {
            OledMoveTo(xco,yco);
            OledLineTo(xco, yco+2);
        }
    }
}
示例#3
0
/***	void IOShieldOledClass::drawLine(int xco, int yco)
**
**	Parameters:
**		xco			- x coordinate
**		yco			- y coordinate
**
**	Return Value:
**		none
**
**	Errors:
**		none
**
**	Description:
**		Draw a line from the current position to the specified
**		position.
*/
void IOShieldOledClass::drawLine(int xco, int yco)
{
	OledLineTo(xco, yco);
}