Permalink
Browse files

adding guts

  • Loading branch information...
1 parent 10fcdb4 commit e5f1d9b311cc6d5ef0a425405a40029384d3b104 @swantron committed Oct 16, 2011
Showing with 186 additions and 0 deletions.
  1. +18 −0 AndroidManifest.xml
  2. BIN bin/IOIOSeek.apk
  3. BIN bin/classes.dex
  4. BIN bin/ioio/lib/api/AnalogInput.class
  5. BIN bin/ioio/lib/api/Closeable.class
  6. BIN bin/ioio/lib/api/DigitalInput$Spec$Mode.class
  7. BIN bin/ioio/lib/api/DigitalInput$Spec.class
  8. BIN bin/ioio/lib/api/DigitalInput.class
  9. BIN bin/ioio/lib/api/DigitalOutput$Spec$Mode.class
  10. BIN bin/ioio/lib/api/DigitalOutput$Spec.class
  11. BIN bin/ioio/lib/api/DigitalOutput.class
  12. BIN bin/ioio/lib/api/IOIO$VersionType.class
  13. BIN bin/ioio/lib/api/IOIO.class
  14. BIN bin/ioio/lib/api/IOIOFactory.class
  15. BIN bin/ioio/lib/api/IcspMaster.class
  16. BIN bin/ioio/lib/api/PulseInput$ClockRate.class
  17. BIN bin/ioio/lib/api/PulseInput$PulseMode.class
  18. BIN bin/ioio/lib/api/PulseInput.class
  19. BIN bin/ioio/lib/api/PwmOutput.class
  20. BIN bin/ioio/lib/api/SpiMaster$Config.class
  21. BIN bin/ioio/lib/api/SpiMaster$Rate.class
  22. BIN bin/ioio/lib/api/SpiMaster$Result.class
  23. BIN bin/ioio/lib/api/SpiMaster.class
  24. BIN bin/ioio/lib/api/TwiMaster$Rate.class
  25. BIN bin/ioio/lib/api/TwiMaster$Result.class
  26. BIN bin/ioio/lib/api/TwiMaster.class
  27. BIN bin/ioio/lib/api/Uart$Parity.class
  28. BIN bin/ioio/lib/api/Uart$StopBits.class
  29. BIN bin/ioio/lib/api/Uart.class
  30. BIN bin/ioio/lib/api/exception/ConnectionLostException.class
  31. BIN bin/ioio/lib/api/exception/IncompatibilityException.class
  32. BIN bin/ioio/lib/api/exception/OutOfResourceException.class
  33. BIN bin/ioio/lib/impl/AbstractPin.class
  34. BIN bin/ioio/lib/impl/AbstractResource$State.class
  35. BIN bin/ioio/lib/impl/AbstractResource.class
  36. BIN bin/ioio/lib/impl/AnalogInputImpl.class
  37. BIN bin/ioio/lib/impl/Constants.class
  38. BIN bin/ioio/lib/impl/DigitalInputImpl.class
  39. BIN bin/ioio/lib/impl/DigitalOutputImpl.class
  40. BIN bin/ioio/lib/impl/FlowControlledOutputStream$FlushThread.class
  41. BIN bin/ioio/lib/impl/FlowControlledOutputStream$Sender.class
  42. BIN bin/ioio/lib/impl/FlowControlledOutputStream.class
  43. BIN bin/ioio/lib/impl/FlowControlledPacketSender$FlushThread.class
  44. BIN bin/ioio/lib/impl/FlowControlledPacketSender$Packet.class
  45. BIN bin/ioio/lib/impl/FlowControlledPacketSender$Sender.class
  46. BIN bin/ioio/lib/impl/FlowControlledPacketSender.class
  47. BIN bin/ioio/lib/impl/IOIOConnection.class
  48. BIN bin/ioio/lib/impl/IOIOImpl$State.class
  49. BIN bin/ioio/lib/impl/IOIOImpl.class
  50. BIN bin/ioio/lib/impl/IOIOProtocol$IncomingHandler.class
  51. BIN bin/ioio/lib/impl/IOIOProtocol$IncomingThread.class
  52. BIN bin/ioio/lib/impl/IOIOProtocol$PwmScale.class
  53. BIN bin/ioio/lib/impl/IOIOProtocol.class
  54. BIN bin/ioio/lib/impl/IcspMasterImpl.class
  55. BIN bin/ioio/lib/impl/IncapImpl.class
  56. BIN bin/ioio/lib/impl/IncomingState$ConnectionState.class
  57. BIN bin/ioio/lib/impl/IncomingState$DataModuleListener.class
  58. BIN bin/ioio/lib/impl/IncomingState$DataModuleState.class
  59. BIN bin/ioio/lib/impl/IncomingState$DisconnectListener.class
  60. BIN bin/ioio/lib/impl/IncomingState$InputPinListener.class
  61. BIN bin/ioio/lib/impl/IncomingState$InputPinState.class
  62. BIN bin/ioio/lib/impl/IncomingState.class
  63. BIN bin/ioio/lib/impl/ModuleAllocator.class
  64. BIN bin/ioio/lib/impl/PinFunctionMap.class
  65. BIN bin/ioio/lib/impl/PwmImpl.class
  66. BIN bin/ioio/lib/impl/QueueInputStream.class
  67. BIN bin/ioio/lib/impl/SocketIOIOConnection.class
  68. BIN bin/ioio/lib/impl/SpiMasterImpl$OutgoingPacket.class
  69. BIN bin/ioio/lib/impl/SpiMasterImpl$SpiResult.class
  70. BIN bin/ioio/lib/impl/SpiMasterImpl.class
  71. BIN bin/ioio/lib/impl/TwiMasterImpl$OutgoingPacket.class
  72. BIN bin/ioio/lib/impl/TwiMasterImpl$TwiResult.class
  73. BIN bin/ioio/lib/impl/TwiMasterImpl.class
  74. BIN bin/ioio/lib/impl/UartImpl.class
  75. BIN bin/ioio/lib/util/AbstractIOIOActivity$IOIOThread.class
  76. BIN bin/ioio/lib/util/AbstractIOIOActivity.class
  77. BIN bin/resources.ap_
  78. BIN bin/swantron/project/seek/IOIOSeek$1.class
  79. BIN bin/swantron/project/seek/IOIOSeek$2.class
  80. BIN bin/swantron/project/seek/IOIOSeek$IOIOThread.class
  81. BIN bin/swantron/project/seek/IOIOSeek.class
  82. BIN bin/swantron/project/seek/R$attr.class
  83. BIN bin/swantron/project/seek/R$drawable.class
  84. BIN bin/swantron/project/seek/R$id.class
  85. BIN bin/swantron/project/seek/R$layout.class
  86. BIN bin/swantron/project/seek/R$string.class
  87. BIN bin/swantron/project/seek/R.class
  88. +12 −0 default.properties
  89. BIN res/drawable-hdpi/icon.png
  90. BIN res/drawable-hdpi/seek_512.png
  91. BIN res/drawable-ldpi/icon.png
  92. BIN res/drawable-mdpi/icon.png
  93. BIN res/drawable/seek.png
  94. +55 −0 res/layout/main.xml
  95. +7 −0 res/values/strings.xml
  96. +94 −0 src/swantron/project/seek/IOIOSeek.java
View
18 AndroidManifest.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ android:versionCode="1"
+ android:versionName="1.0" package="swantron.project.seek">
+ <uses-sdk android:minSdkVersion="3" />
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".IOIOSeek"
+ android:label="@string/app_name"
+ android:configChanges="orientation|keyboardHidden">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+ <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+</manifest>
View
BIN bin/IOIOSeek.apk
Binary file not shown.
View
BIN bin/classes.dex
Binary file not shown.
View
BIN bin/ioio/lib/api/AnalogInput.class
Binary file not shown.
View
BIN bin/ioio/lib/api/Closeable.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalInput$Spec$Mode.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalInput$Spec.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalInput.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalOutput$Spec$Mode.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalOutput$Spec.class
Binary file not shown.
View
BIN bin/ioio/lib/api/DigitalOutput.class
Binary file not shown.
View
BIN bin/ioio/lib/api/IOIO$VersionType.class
Binary file not shown.
View
BIN bin/ioio/lib/api/IOIO.class
Binary file not shown.
View
BIN bin/ioio/lib/api/IOIOFactory.class
Binary file not shown.
View
BIN bin/ioio/lib/api/IcspMaster.class
Binary file not shown.
View
BIN bin/ioio/lib/api/PulseInput$ClockRate.class
Binary file not shown.
View
BIN bin/ioio/lib/api/PulseInput$PulseMode.class
Binary file not shown.
View
BIN bin/ioio/lib/api/PulseInput.class
Binary file not shown.
View
BIN bin/ioio/lib/api/PwmOutput.class
Binary file not shown.
View
BIN bin/ioio/lib/api/SpiMaster$Config.class
Binary file not shown.
View
BIN bin/ioio/lib/api/SpiMaster$Rate.class
Binary file not shown.
View
BIN bin/ioio/lib/api/SpiMaster$Result.class
Binary file not shown.
View
BIN bin/ioio/lib/api/SpiMaster.class
Binary file not shown.
View
BIN bin/ioio/lib/api/TwiMaster$Rate.class
Binary file not shown.
View
BIN bin/ioio/lib/api/TwiMaster$Result.class
Binary file not shown.
View
BIN bin/ioio/lib/api/TwiMaster.class
Binary file not shown.
View
BIN bin/ioio/lib/api/Uart$Parity.class
Binary file not shown.
View
BIN bin/ioio/lib/api/Uart$StopBits.class
Binary file not shown.
View
BIN bin/ioio/lib/api/Uart.class
Binary file not shown.
View
BIN bin/ioio/lib/api/exception/ConnectionLostException.class
Binary file not shown.
View
BIN bin/ioio/lib/api/exception/IncompatibilityException.class
Binary file not shown.
View
BIN bin/ioio/lib/api/exception/OutOfResourceException.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/AbstractPin.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/AbstractResource$State.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/AbstractResource.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/AnalogInputImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/Constants.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/DigitalInputImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/DigitalOutputImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledOutputStream$FlushThread.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledOutputStream$Sender.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledOutputStream.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledPacketSender$FlushThread.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledPacketSender$Packet.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledPacketSender$Sender.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/FlowControlledPacketSender.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOConnection.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOImpl$State.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOProtocol$IncomingHandler.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOProtocol$IncomingThread.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOProtocol$PwmScale.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IOIOProtocol.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IcspMasterImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncapImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$ConnectionState.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$DataModuleListener.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$DataModuleState.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$DisconnectListener.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$InputPinListener.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState$InputPinState.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/IncomingState.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/ModuleAllocator.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/PinFunctionMap.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/PwmImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/QueueInputStream.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/SocketIOIOConnection.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/SpiMasterImpl$OutgoingPacket.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/SpiMasterImpl$SpiResult.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/SpiMasterImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/TwiMasterImpl$OutgoingPacket.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/TwiMasterImpl$TwiResult.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/TwiMasterImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/impl/UartImpl.class
Binary file not shown.
View
BIN bin/ioio/lib/util/AbstractIOIOActivity$IOIOThread.class
Binary file not shown.
View
BIN bin/ioio/lib/util/AbstractIOIOActivity.class
Binary file not shown.
View
BIN bin/resources.ap_
Binary file not shown.
View
BIN bin/swantron/project/seek/IOIOSeek$1.class
Binary file not shown.
View
BIN bin/swantron/project/seek/IOIOSeek$2.class
Binary file not shown.
View
BIN bin/swantron/project/seek/IOIOSeek$IOIOThread.class
Binary file not shown.
View
BIN bin/swantron/project/seek/IOIOSeek.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R$attr.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R$drawable.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R$id.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R$layout.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R$string.class
Binary file not shown.
View
BIN bin/swantron/project/seek/R.class
Binary file not shown.
View
12 default.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-3
+android.library.reference.1=../../IOIOLib
View
BIN res/drawable-hdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-hdpi/seek_512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-ldpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/seek.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
55 res/layout/main.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/seekbar1_label"
+ />
+ <SeekBar
+ android:id="@+id/SeekBar1"
+ android:layout_width="fill_parent"
+ android:max="1000"
+ android:progress="500"
+ android:layout_height="50dp"/>
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/seekbar2_label"
+ />
+ <SeekBar
+ android:id="@+id/SeekBar2"
+ android:layout_width="fill_parent"
+ android:max="1000"
+ android:progress="500" android:layout_height="50dp"/>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:paddingTop="20px">
+ <TextView
+ android:text="@string/analog_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingRight="5px"
+ />
+ <TextView
+ android:id="@+id/TextView"
+ android:text="0"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+
+ <ToggleButton
+ android:id="@+id/ToggleButton"
+ android:layout_gravity="center_horizontal"
+ android:layout_margin="20px"
+ android:textOff="~~~~0~~~~"
+ android:textOn="~~~~1~~~~"
+ android:layout_width="fill_parent" android:layout_height="50dp"/>
+ <ImageView android:layout_height="wrap_content" android:id="@+id/imageView1" android:layout_width="wrap_content" android:src="@drawable/seek"></ImageView>
+</LinearLayout>
View
7 res/values/strings.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">IOIOSeek</string>
+ <string name="seekbar1_label">pan servo one</string>
+ <string name="seekbar2_label">pan servo two</string>
+ <string name="analog_label">relative solar reading</string>
+</resources>
View
94 src/swantron/project/seek/IOIOSeek.java
@@ -0,0 +1,94 @@
+package swantron.project.seek;
+
+import ioio.lib.api.AnalogInput;
+import ioio.lib.api.DigitalOutput;
+import ioio.lib.api.IOIO;
+import ioio.lib.api.PwmOutput;
+import ioio.lib.api.exception.ConnectionLostException;
+import ioio.lib.util.AbstractIOIOActivity;
+import android.os.Bundle;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import android.widget.ToggleButton;
+
+public class IOIOSeek extends AbstractIOIOActivity {
+ private TextView textView_;
+ private SeekBar seekBar1_;
+ private SeekBar seekBar2_;
+ private ToggleButton toggleButton_;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ textView_ = (TextView)findViewById(R.id.TextView);
+ seekBar1_ = (SeekBar)findViewById(R.id.SeekBar1);
+ seekBar2_ = (SeekBar)findViewById(R.id.SeekBar2);
+ toggleButton_ = (ToggleButton)findViewById(R.id.ToggleButton);
+
+ enableUi(false);
+ }
+
+ class IOIOThread extends AbstractIOIOActivity.IOIOThread {
+ private AnalogInput input_;
+ private PwmOutput pwmOutput1_;
+ private PwmOutput pwmOutput2_;
+ private DigitalOutput led_;
+
+
+ public void setup() throws ConnectionLostException {
+ try {
+ input_ = ioio_.openAnalogInput(40);
+ pwmOutput1_ = ioio_.openPwmOutput(12, 100);
+ pwmOutput2_ = ioio_.openPwmOutput(13, 100);
+ led_ = ioio_.openDigitalOutput(25, false);
+ enableUi(true);
+ } catch (ConnectionLostException e) {
+ enableUi(false);
+ throw e;
+ }
+ }
+
+ public void loop() throws ConnectionLostException {
+ try {
+ final float reading = input_.read();
+ setText(Float.toString(reading));
+ pwmOutput1_.setPulseWidth(500 + seekBar1_.getProgress() * 2);
+ pwmOutput2_.setPulseWidth(500 + seekBar2_.getProgress() * 2);
+ led_.write(!toggleButton_.isChecked());
+ sleep(10);
+ } catch (InterruptedException e) {
+ ioio_.disconnect();
+ } catch (ConnectionLostException e) {
+ enableUi(false);
+ throw e;
+ }
+ }
+ }
+
+ @Override
+ protected AbstractIOIOActivity.IOIOThread createIOIOThread() {
+ return new IOIOThread();
+ }
+
+ private void enableUi(final boolean enable) {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ seekBar1_.setEnabled(enable);
+ seekBar2_.setEnabled(enable);
+ toggleButton_.setEnabled(enable);
+ }
+ });
+ }
+
+ private void setText(final String str) {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ textView_.setText(str);
+ }
+ });
+ }
+}

0 comments on commit e5f1d9b

Please sign in to comment.