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


Java IOIOLooper类代码示例

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


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

示例1: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
protected IOIOLooper createIOIOLooper() {
    return new BaseIOIOLooper(){
        Uart uart;
        OutputStream ostream;

        @Override
        protected void setup() throws ConnectionLostException, InterruptedException {
            Thread.sleep(5000);
            //led_ = ioio_.openDigitalOutput(0, true);
            uart = ioio_.openUart(35,34,57600, Uart.Parity.NONE, Uart.StopBits.ONE);
            ostream = uart.getOutputStream();
        }
        @Override
        public void loop() throws ConnectionLostException, InterruptedException {
            try {
                ostream.write("sending data".getBytes());
                Thread.sleep(100);
            }
            catch (IOException ex) {
                //showToast("CommunicationThread: "+ ex.getMessage());
                Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
            }
        }
    };
}
 
开发者ID:mike168m,项目名称:USLI2018,代码行数:27,代码来源:CommuncationService.java

示例2: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的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

示例3: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的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

示例4: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
protected IOIOLooper createIOIOLooper() {
    MLog.d(TAG, "createIOIOLooper");
    return new BaseIOIOLooper() {
        @Override
        protected void setup() throws ConnectionLostException, InterruptedException {
            MLog.d(TAG, "Setup in IOIOLooper");
            callback_.onConnect(ioio_);
            callback_.setup();
            // abort_ = (resp != null && resp != true);
        }

        @Override
        public void loop() throws ConnectionLostException, InterruptedException {
            if (abort_) {
                this.disconnected();
            } else {
                callback_.loop();
                // abort_ = (resp != null && resp != true);
                Thread.sleep(100);
            }
        }

        @Override
        public void disconnected() {
            super.disconnected();
            MLog.d("IOIOBoardService", "-----> Disconnecting <-----");
            ioio_.disconnect();
        }
    };
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:32,代码来源:IOIOBoardService.java

示例5: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
public IOIOLooper createIOIOLooper(String connectionType, Object extra) {
    return new Looper();
}
 
开发者ID:infil00p,项目名称:ELControl,代码行数:5,代码来源:MainActivity.java

示例6: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
public IOIOLooper createIOIOLooper(String connectionType, Object extra) {
	return createIOIOLooper();
}
 
开发者ID:jrieke,项目名称:ioiometer,代码行数:5,代码来源:IOIOService.java

示例7: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
public IOIOLooper createIOIOLooper(String connectionType, Object extra) {
    return createIOIOLooper();
}
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:5,代码来源:IOIOService.java

示例8: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
protected IOIOLooper createIOIOLooper() {
	return new IOIOThread();
}
 
开发者ID:alinke,项目名称:PixelEditor,代码行数:5,代码来源:PIXELWrite.java

示例9: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
  protected IOIOLooper createIOIOLooper() {
if(MainActivity.looper == null)
      	MainActivity.looper = new Looper();
      return MainActivity.looper;
  }
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:7,代码来源:MainActivity.java

示例10: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
	protected IOIOLooper createIOIOLooper() {
		return new BaseIOIOLooper() {
			private AnalogInput in43, in44;

			@Override
			protected void setup() throws ConnectionLostException,
					InterruptedException {
//				led_ = ioio_.openDigitalOutput(IOIO.LED_PIN);
				in43 = ioio_.openAnalogInput(43);
				in44 = ioio_.openAnalogInput(44);
			}

			@Override
			public void loop() throws ConnectionLostException,
					InterruptedException {
				//led_.write(ledState);
				//ledState = !ledState;
				double v, sm, v1, v2;
				try {
					v = in43.read();
					ma43.newFrame(v);
					sm = ma43.median();
					v1 = sm;

					v = in44.read();
					ma44.newFrame(v);
					sm = ma44.median();
					v2 = sm;

					maDiff.newFrame((v2 - v1));
					int status = 0;
					if (v1 < 0.4 && v2 < 0.4) {
						// off
					} else {
						// get dists
						double val = maDiff.median();
						Log.i(TAG, "Diff: " + val);
						dists[0] = Math.abs(class1 - val);
						dists[1] = Math.abs(class2 - val);
						dists[2] = Math.abs(class3 - val);
						int idx = 0;
						double minVal = Double.MAX_VALUE;
						for (int i = 0; i < 3; i++) {
							if (dists[i] < minVal) {
								idx = i;
								minVal = dists[i];
							}
						}
						status = idx + 1;
					}

					if (statusTrig.newFrame(status)) {
						AssistanceReport.postAssistanceStatus(new ModeChangeEvent(status, System.currentTimeMillis()), phoneID);
					}

				} catch (InterruptedException e1) {
					// TODO Auto-generated catch block
					Log.i("IOIO", "error while reading IOIO");
					e1.printStackTrace();
				}

				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
				}
			}

		};
	}
 
开发者ID:smartebikes,项目名称:SmartEbikesMonitorSystem,代码行数:71,代码来源:EBikesDoverIOIOService.java

示例11: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
protected IOIOLooper createIOIOLooper() {
	return new Looper();
}
 
开发者ID:victordiaz,项目名称:MakeWithMotoSampleApp,代码行数:4,代码来源:ActivityMOIO.java

示例12: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
@Override
protected IOIOLooper createIOIOLooper() {
	return new Looper();
}
 
开发者ID:PinkHatSpike,项目名称:pioio,代码行数:5,代码来源:IOIOSimpleApp.java

示例13: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
/**
* IOIOLooperProvider stuff
*/
@Override
public IOIOLooper createIOIOLooper(String connectionType, Object extra) {
    return this.createIOIOLooper();
}
 
开发者ID:PinkHatSpike,项目名称:pioio,代码行数:8,代码来源:PIOIOLooperProvider.java

示例14: createIOIOLooper

import ioio.lib.util.IOIOLooper; //导入依赖的package包/类
/**
 * A method to create our IOIO thread.
 * 
 * @see ioio.lib.util.AbstractIOIOActivity#createIOIOThread()
 */
@Override
protected IOIOLooper createIOIOLooper() {
	return new Looper();
}
 
开发者ID:IeiuniumLux,项目名称:AAV,代码行数:10,代码来源:AAVActivity.java


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