示例#1
0
文件: draw.c 项目: ahmedlogic/LEDcube
// Set a plane using the functions above
void setplane(unsigned char plane, int i, int state)
{
	if (plane == "x")
	{
		if (state > 0)
		{
			setplane_x(i);
		} else
		{
			clrplane_x(i);
		}
	}
	
	if (plane == "y")
	{
		if (state > 0)
		{
			setplane_y(i);
		} else
		{
			clrplane_y(i);
		}
	}
	
	if (plane == "z")
	{
		if (state > 0)
		{
			setplane_z(i);
		} else
		{
			clrplane_z(i);
		}
	}
}
示例#2
0
文件: main.c 项目: TheJuffo/LedCube
void SelfTest()
{
	int i, x, y;

	for(i = 0; i < 7; i++)
	{
		setplane_z(i);
		delay_ms(1000);	
		clrplane_z(i);
	}
	for(x = 0; x <= 7; x++)
	{
		for(y = 0; y <= 7; y++)
		{
			line(x, y, 0, x, y, 7);
			delay_ms(1000);
			fill(0);
		}
	}
}