当前位置: 首页>>代码示例>>Java>>正文


Java Sound.beepSequenceUp方法代码示例

本文整理汇总了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); 
}
 
开发者ID:jornfranke,项目名称:lejos-ev3-example,代码行数:21,代码来源:RobotApplication.java

示例2: stop

import lejos.hardware.Sound; //导入方法依赖的package包/类
public void stop() throws IOException {
    pilot.stop();
    Sound.beepSequenceUp();
    sock.close();
    server.close();
    System.exit(0);
}
 
开发者ID:JINKEHE,项目名称:Rescue-Victims,代码行数:8,代码来源:Megatron.java

示例3: doCelebration

import lejos.hardware.Sound; //导入方法依赖的package包/类
private void doCelebration() {
    Sound.beepSequence();
    Sound.beepSequenceUp();
    Sound.beep();
}
 
开发者ID:JINKEHE,项目名称:Rescue-Victims,代码行数:6,代码来源:Megatron.java

示例4: raceFinished

import lejos.hardware.Sound; //导入方法依赖的package包/类
public void raceFinished() {
	Button.LEDPattern(4);	
	Sound.beepSequenceUp();
}
 
开发者ID:phllipo,项目名称:RoboRace,代码行数:5,代码来源:AudioVideoController.java

示例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);
}
 
开发者ID:stahlfabrik,项目名称:TRAC3R,代码行数:61,代码来源:TRAC3RsArm.java

示例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);
	}
 
开发者ID:SnakeSVx,项目名称:ev3,代码行数:66,代码来源:Ballbot.java

示例7: beepSequenceUp

import lejos.hardware.Sound; //导入方法依赖的package包/类
@Override
public void beepSequenceUp() throws RemoteException {
	Sound.beepSequenceUp();
}
 
开发者ID:SnakeSVx,项目名称:ev3,代码行数:5,代码来源:RMIRemoteSound.java


注:本文中的lejos.hardware.Sound.beepSequenceUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。