Code example for DataOutputStream

Methods: flush, writeByte, writeFloat

0
	} 
	 
	public void travel(float speed) {
		Log.i(TAG, "Travel called: " + speed);
		try { 
			mOs.writeByte(COMMAND_TRAVEL);
			mOs.writeFloat(speed);
			mOs.flush();
		} catch (Exception e) {
			Log.e(TAG, "Could not send commands (" + e.getMessage() + ")");
		} 
	} 
	 
	public void steer(float turnRate) {
		Log.i(TAG, "Steer called: " + turnRate);
		try { 
			mOs.writeByte(COMMAND_STEER);
			mOs.writeFloat(turnRate);
			mOs.flush();
		} catch (Exception e) {
			Log.e(TAG, "Could not send commands (" + e.getMessage() + ")");