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


Java IOIO类代码示例

本文整理汇总了Java中ioio.lib.api.IOIO的典型用法代码示例。如果您正苦于以下问题:Java IOIO类的具体用法?Java IOIO怎么用?Java IOIO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IOIO类属于ioio.lib.api包,在下文中一共展示了IOIO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConnect

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public void onConnect(Object obj) {
    this.mIoio = (IOIO) obj;
    MLog.d(TAG, "MOIO Connected");

    if (mIoioCallbackfn != null) {
        mIoioCallbackfn.event();
    }

    mIoioStarted = true;
    mHandler.post(new Runnable() {

        @Override
        public void run() {
        }
    });
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:18,代码来源:PIOIO.java

示例2: setStatusText

import ioio.lib.api.IOIO; //导入依赖的package包/类
public void setStatusText(final String str,final Status which,final boolean goodNews) {
	runOnUiThread(new Runnable() {
		@Override
		public void run() {
               TextView statView=null;
               switch(which){
                   case NETWORK:
                       statView = networkStatus;
                       break;
                   case IOIO:
                       statView = IOIOstatus;
                       break;
               }
               if(statView==null)
                   return;
               statView.setText(str);
               if(goodNews)
                   statView.setBackgroundColor(getResources().getColor(R.color.online));
               else
                   statView.setBackgroundColor(getResources().getColor(R.color.offline));
		}
	});
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:24,代码来源:MainActivity.java

示例3: createIOIOLooper

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
protected IOIOLooper createIOIOLooper() {
	return new BaseIOIOLooper() {
		private DigitalOutput led_;

		@Override
		protected void setup() throws ConnectionLostException,
				InterruptedException {
			led_ = ioio_.openDigitalOutput(IOIO.LED_PIN);
		}

		@Override
		public void loop() throws ConnectionLostException,
				InterruptedException {
			led_.write(false);
			Thread.sleep(500);
			led_.write(true);
			Thread.sleep(500);
		}
	};
}
 
开发者ID:PinkHatSpike,项目名称:pioio,代码行数:22,代码来源:HelloIOIOService.java

示例4: createIOIOLooper

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public IOIOLooper createIOIOLooper(String connectionType, Object extra) {
	return new BaseIOIOLooper() {
		private DigitalOutput led_;

		@Override
		protected void setup() throws ConnectionLostException,
				InterruptedException {
			led_ = ioio_.openDigitalOutput(IOIO.LED_PIN, true);
		}

		@Override
		public void loop() throws ConnectionLostException,
				InterruptedException {
			led_.write(!ledOn_);
			Thread.sleep(10);
		}
	};
}
 
开发者ID:PinkHatSpike,项目名称:pioio,代码行数:20,代码来源:HelloIOIOConsole.java

示例5: close

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
synchronized public void close() {
	super.close();
	incoming_.close();
	outgoing_.close();
	ioio_.closeUart(uartNum_);
	if (rxPinNum_ != IOIO.INVALID_PIN) {
		ioio_.closePin(rxPinNum_);
	}
	if (txPinNum_ != IOIO.INVALID_PIN) {
		ioio_.closePin(txPinNum_);
	}
}
 
开发者ID:jrieke,项目名称:ioiometer,代码行数:14,代码来源:UartImpl.java

示例6: showVersions

import ioio.lib.api.IOIO; //导入依赖的package包/类
private void showVersions(IOIO ioio, String title) {
    toast(String.format("%s\n" +
                    "IOIOLib: %s\n" +
                    "Application firmware: %s\n" +
                    "Bootloader firmware: %s\n" +
                    "Hardware: %s",
            title,
            ioio.getImplVersion(VersionType.IOIOLIB_VER),
            ioio.getImplVersion(VersionType.APP_FIRMWARE_VER),
            ioio.getImplVersion(VersionType.BOOTLOADER_VER),
            ioio.getImplVersion(VersionType.HARDWARE_VER)));
}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:13,代码来源:MainActivity.java

示例7: setup

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public void setup(IOIO ioio_){
    try {
        analogInput = ioio_.openAnalogInput(sensorPin);

    } catch (ConnectionLostException e) {
        e.printStackTrace();
    }
}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:10,代码来源:AirQualitySensor.java

示例8: process

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public void process(IOIO ioio_) throws ConnectionLostException, InterruptedException {

    trigger.setPulseWidth(8000);
    distance = (echo.getDuration() * 1000 * 1000 ) / 29f / 2f;
    if (distance>2 && distance < 700){
        sendData(distance);
    }

}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:11,代码来源:UsRangeFinder.java

示例9: showVersions

import ioio.lib.api.IOIO; //导入依赖的package包/类
private void showVersions(IOIO ioio, String title) {
	toast(String.format("%s\n" + "IOIOLib: %s\n"
			+ "Application firmware: %s\n" + "Bootloader firmware: %s\n"
			+ "Hardware: %s", title,
			ioio.getImplVersion(VersionType.IOIOLIB_VER),
			ioio.getImplVersion(VersionType.APP_FIRMWARE_VER),
			ioio.getImplVersion(VersionType.BOOTLOADER_VER),
			ioio.getImplVersion(VersionType.HARDWARE_VER)));
}
 
开发者ID:brycedjohnson,项目名称:Android-Timelapse,代码行数:10,代码来源:HelloIOIOService.java

示例10: setup

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public void setup() throws ConnectionLostException {
	led_ = ioio_.openDigitalOutput(IOIO.LED_PIN, true);
	input_ = ioio_.openAnalogInput(40);
	pwmOutput_ = ioio_.openPwmOutput(12, 100);
	enableUi(true);
}
 
开发者ID:PinkHatSpike,项目名称:pioio,代码行数:8,代码来源:IOIOSimpleApp.java

示例11: Helper

import ioio.lib.api.IOIO; //导入依赖的package包/类
public Helper(IOIO _ioio, KrypgrundsService kryp, String id, String ver, ServiceMode mode) {
	ioio = _ioio;
	krypService = kryp;
	imei = id;
	version = ver;
	mCtx = kryp.getApplicationContext();
	if (ioio != null) {
		try {
			// if (mode == ServiceMode.Survfind) {
			anemometer = ioio.openAnalogInput(ANEMOMETER_WIND_VANE);
			if (GET_SPEED_VERSION == FrequencyReading.Analogue_Reading) {
				mAnalogPulsecounter = ioio.openAnalogInput(ANEMOMETER_SPEED);
			} else if (GET_SPEED_VERSION == FrequencyReading.Continuos_Reading) {
				Spec spec = new Spec(ANEMOMETER_SPEED);
				spec.mode = Mode.PULL_UP;
				pulseCounter = ioio.openPulseInput(spec, ClockRate.RATE_16MHz, PulseMode.FREQ, true);
			} else if (GET_SPEED_VERSION == FrequencyReading.OpenClose_Reading) {
				// Do nothing as open and close will be done at every
				// call.
			}
			// } else if (mode == ServiceMode.Krypgrund) {
			i2cInne = ioio.openTwiMaster(2, TwiMaster.Rate.RATE_100KHz, false);
			i2cUte = ioio.openTwiMaster(1, TwiMaster.Rate.RATE_100KHz, false);
			// }

			// On board sensors. Are they used?
			power = ioio.openAnalogInput(42);

			B2 = ioio.openDigitalOutput(20);
			B1 = ioio.openDigitalOutput(19);
			B1.write(mFanOn);
			B2.write(mFanOn);

		} catch (Exception e) {
			e.printStackTrace();
		} // USE FALSE for I2C otherwise to high voltage!!!
	}
}
 
开发者ID:edarn,项目名称:kryp-client,代码行数:39,代码来源:Helper.java

示例12: get

import ioio.lib.api.IOIO; //导入依赖的package包/类
public IOIO get() {
    return mIoio;
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:4,代码来源:PIOIO.java

示例13: setup

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public final void setup(IOIO ioio) throws ConnectionLostException,
		InterruptedException {
	ioio_ = ioio;
	setup();
}
 
开发者ID:jrieke,项目名称:ioiometer,代码行数:7,代码来源:BaseIOIOLooper.java

示例14: setup

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public final void setup(IOIO ioio) throws ConnectionLostException,
        InterruptedException {
    ioio_ = ioio;
    setup();
}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:7,代码来源:BaseIOIOLooper.java

示例15: incompatible

import ioio.lib.api.IOIO; //导入依赖的package包/类
@Override
public final void incompatible(IOIO ioio) {
    ioio_ = ioio;
    incompatible();
}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:6,代码来源:BaseIOIOLooper.java


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