Beispiel #1
0
void setup()
{
	initBoard();
	for(unsigned int _i=0; _i<(unsigned int)(20); _i++)
	{
		toneWithDelay(BuzzerPin, (Random()*100), 200);
	}
}
void setup()
{
	initBoard();
	while(true)
	{
		toneWithDelay(BuzzerPin, (abs(accel.readZ())*0.1), (abs(accel.readY())*0.01));
	}
}
Beispiel #3
0
void setup()
{
	initBoard();
	float factor = 0.1;
	while(true)
	{
		toneWithDelay(BuzzerPin, (abs(accel.readZ())*factor), 50);
	}
}
Beispiel #4
0
void setup()
{
	initBoard();
	float code = 0;
	while(true)
	{
		code = irReceiver.getIRRemoteCode();
		toneWithDelay(BuzzerPin, (code*440), 250);
		serial0.println(code);
	}
}
void setup()
{
	initBoard();
	while(true)
	{
		if(DigitalRead(D14))
		{
			DigitalWrite(D14, true);
			toneWithDelay(BuzzerPin, NOTE_E4, 100);
		}
		else
		{
			DigitalWrite(D14, false);
		}
	}
}
Beispiel #6
0
void setup()
{
	initBoard();
	toneWithDelay(BuzzerPin, NOTE_C4, 300);
	toneWithDelay(BuzzerPin, NOTE_B4, 200);
}
Beispiel #7
0
void setup()
{
	initBoard();
	float vel = 80;
	float spinVel = 70;
	float code = 0;
	while(true)
	{
		code = irReceiver.getIRRemoteCode();
		if(((int)(code)==(int)(2)))
		{
			robot.motor0(vel);
			robot.motor1(vel);
		}
		else
		{
		}
		if(((int)(code)==(int)(8)))
		{
			robot.motor0(-(vel));
			robot.motor1(-(vel));
		}
		else
		{
		}
		if(((int)(code)==(int)(4)))
		{
			robot.motor0(-(spinVel));
			robot.motor1(spinVel);
		}
		else
		{
		}
		if(((int)(code)==(int)(6)))
		{
			robot.motor0(spinVel);
			robot.motor1(-(spinVel));
		}
		else
		{
		}
		if(((int)(code)==(int)(3)))
		{
			robot.motor0(vel);
			robot.motor1((vel*0.7));
		}
		else
		{
		}
		if(((int)(code)==(int)(1)))
		{
			robot.motor0((vel*0.7));
			robot.motor1(vel);
		}
		else
		{
		}
		if(((int)(code)==(int)(5)))
		{
			toneWithDelay(BuzzerPin, 880, 150);
			robot.motor0(0);
			robot.motor1(0);
		}
		else
		{
		}
		delay(200);
	}
}