本文整理汇总了Java中lejos.hardware.Sound.beepSequenceUp方法的典型用法代码示例。如果您正苦于以下问题:Java Sound.beepSequenceUp方法的具体用法?Java Sound.beepSequenceUp怎么用?Java Sound.beepSequenceUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lejos.hardware.Sound
的用法示例。
在下文中一共展示了Sound.beepSequenceUp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import lejos.hardware.Sound; //导入方法依赖的package包/类
/**
* @param args
*/
public static void main(String[] args) {
GraphicsLCD g = BrickFinder.getDefault().getGraphicsLCD();
final int SW = g.getWidth();
final int SH = g.getHeight();
Button.LEDPattern(4);
Sound.beepSequenceUp();
g.setFont(Font.getDefaultFont());
g.drawString("Lejos EV3 Gradle", SW/2, SH/2, GraphicsLCD.BASELINE|GraphicsLCD.HCENTER);
Button.LEDPattern(3);
Delay.msDelay(4000);
Button.LEDPattern(5);
g.clear();
g.refresh();
Sound.beepSequence();
Delay.msDelay(500);
Button.LEDPattern(0);
}
示例2: stop
import lejos.hardware.Sound; //导入方法依赖的package包/类
public void stop() throws IOException {
pilot.stop();
Sound.beepSequenceUp();
sock.close();
server.close();
System.exit(0);
}
示例3: doCelebration
import lejos.hardware.Sound; //导入方法依赖的package包/类
private void doCelebration() {
Sound.beepSequence();
Sound.beepSequenceUp();
Sound.beep();
}
示例4: raceFinished
import lejos.hardware.Sound; //导入方法依赖的package包/类
public void raceFinished() {
Button.LEDPattern(4);
Sound.beepSequenceUp();
}
示例5: initialize
import lejos.hardware.Sound; //导入方法依赖的package包/类
public void initialize()
{
System.out.println("Initializing arm positon...");
Sound.twoBeeps();
Button.LEDPattern(9);
setBothJointsSpeed(500);
// Find home for motor 1
System.out.println("Homing motor1...");
float[] sample = new float[touchSensor1.sampleSize()];
motor1.forward();
do {
touchSensor1.fetchSample(sample, 0);
Thread.yield();
//Delay.msDelay(10);
} while (sample[0] == 0.0);
motor1.stop();
motor1.resetTachoCount();
System.out.println("... motor1 reached home.");
// Find home for motor 2
System.out.println("Homing motor2...");
motor1.rotateTo((int)(-115 * gearRatio1), false);
motor2.forward();
do {
touchSensor2.fetchSample(sample, 0);
Thread.yield();
//Delay.msDelay(10);
} while (sample[0] == 0.0);
motor2.stop();
motor2.resetTachoCount();
System.out.println("... motor2 reached home.");
//Move to position 0, 0 (degrees)
System.out.println("Stretching arm...");
motor1.rotateTo((int)(-94 * gearRatio1), true);
motor2.rotateTo((int)(-1 * 67 * gearRatio2), true);
while (areJointsMoving()){
Thread.yield();
//Delay.msDelay(10);
}
motor1.resetTachoCount();
motor2.resetTachoCount();
System.out.println("... done");
Sound.beepSequenceUp();
Button.LEDPattern(7);
}
示例6: run
import lejos.hardware.Sound; //导入方法依赖的package包/类
public void run() {
int power;
long tMotorPosOK;
long cLoop = 0;
LCD.clear();
LCD.drawString("leJOS NXJ Ballbot", 0, 1);
LCD.drawString("Balancing", 0, 4);
tMotorPosOK = System.currentTimeMillis();
// Reset the motors to make sure we start at a zero position
my_motor.resetTachoCount();
//right_motor.resetTachoCount();
// NOTE: This balance control loop only takes 1.128 MS to execute each loop in leJOS NXJ.
while(true) {
calcInterval(cLoop++);
updateGyroData();
updateMotorData();
// Apply the drive control value to the motor position to get robot to move.
motorPos -= motorControlDrive * tInterval;
// This is the main balancing equation
power = (int)((KGYROSPEED * gyroSpeed + // Deg/Sec from Gyro sensor
KGYROANGLE * gyroAngle) / ratioWheel + // Deg from integral of gyro
KPOS * motorPos + // From MotorRotaionCount of both motors
KDRIVE * motorControlDrive + // To improve start/stop performance
KSPEED * motorSpeed); // Motor speed in Deg/Sec
if (Math.abs(power) < 100)
tMotorPosOK = System.currentTimeMillis();
steerControl(power); // Movement control. Not used for balancing.
// Apply the power values to the motors
// NOTE: It would be easier/faster to use MotorPort.controlMotorById(), but it needs to be public.
my_motor.setPower(Math.abs(powerLeft));
//right_motor.setPower(Math.abs(powerRight));
if(powerLeft > 0) my_motor.forward();
else my_motor.backward();
//if(powerRight > 0) right_motor.forward();
//else right_motor.backward();
// Check if robot has fallen by detecting that motorPos is being limited
// for an extended amount of time.
if ((System.currentTimeMillis() - tMotorPosOK) > TIME_FALL_LIMIT) break;
try {Thread.sleep(WAIT_TIME);} catch (InterruptedException e) {}
} // end of while() loop
my_motor.flt();
//right_motor.flt();
Sound.beepSequenceUp();
LCD.drawString("Oops... I fell", 0, 4);
LCD.drawString("tInt ms:", 0, 8);
LCD.drawInt((int)tInterval*1000, 9, 8);
}
示例7: beepSequenceUp
import lejos.hardware.Sound; //导入方法依赖的package包/类
@Override
public void beepSequenceUp() throws RemoteException {
Sound.beepSequenceUp();
}