-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplugins_ioio.html
More file actions
166 lines (166 loc) · 7.84 KB
/
Copy pathplugins_ioio.html
File metadata and controls
166 lines (166 loc) · 7.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | plugins_ioio</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/plugins_ioio.html">
<link rel="keywords" href="plugins_ioio">
<link rel="stylesheet" href="/css/style.css">
<link rel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<script src="/clipboard.js"></script>
</head>
<body>
<button onclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<script src="/backtotop.js"></script>
<div class="wrapAll clearfix">
<nav class="navigation">
<div class="logo">
<a href="/"><img src='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<div class="navlinks">
<a href="/pages/download.html">Download</a>
<a href="/pages/news.html">News</a>
<a href="/pages/community.html">Community</a>
<a class='active' href="/pages/articles.html">Resources</a>
<a href="/pages/reference.html">Language Reference</a>
<a href="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsRight">
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/plugins_ioio.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/plugins_ioio.markdown">History</a>
</div>
</div>
<div class="article">
<h1 id="ioio-plugin">IOIO plugin</h1>
<p>The IOIO is a board that provides a host machine the capability of
interfacing with external hardware over a variety of commonly used
protocols. The original IOIO board has been specifically designed to
work with Android devices. The newer IOIO-OTG (“on the go”) boards work
with both Android devices and PC’s. The IOIO board can be connected to
its host over USB or Bluetooth, and provides a high-level Java API on
the host side for using its I/O functions as if they were an integral
part of the client. (<a href="https://github.com/ytai/ioio/wiki">IOIO
website</a>)</p>
<h2 id="how-to-learn-coding-for-ioio">How to learn coding for IOIO</h2>
<p>For most of the protocols you can find a SmallBASIC example at <a
href="https://github.com/smallbasic/smallbasic.plugins/tree/master/ioio/samples">Github</a>.
Below is a list with all examples and an image how to wire. If you are
new to IOIO it is best to start with the first example.</p>
<p>A simple SmallBASIC cheatsheet is available at <a
href="https://github.com/smallbasic/smallbasic.plugins/tree/master/ioio">Github</a>.</p>
<p>For further information please visit the <a
href="https://github.com/ytai/ioio/wiki">IOIO website</a>.</p>
<h2 id="how-to-setup-smallbasic-to-use-the-ioio-plugin">How to setup
SmallBASIC to use the IOIO plugin</h2>
<p>Getting IOIO running on a PC (Linux) requires to build the plugin
from source. This is not part of this document.</p>
<p>Using IOIO on Android is quite easy:</p>
<ul>
<li>Launch SmallBASIC and then click on “Setup”.</li>
<li>On the second screen, click to “Load extension modules”.</li>
<li>Restart SmallBASIC and then click “About”. You should see:
“Extension modules: enabled”.</li>
<li>If you have enabled Android developer options, make sure USB
debugging is disabled.</li>
<li>On your IOIO-OTG board, connect a power source to the VIN + GND.
<ul>
<li>IOIO should be powered by an external DC voltage source between
5V-15V.</li>
<li>9V battery works well.</li>
<li>But it is better to connect a 5V power supply.</li>
<li>Instead of VIN + GND you can use the 2-pin JST Female Power
Jack</li>
</ul></li>
<li>Connect a USB cable between your mobile or tablet and the board (use
the included red adaptor plus another cable).</li>
<li>You should see “IOIO Standard application - no installed apps”.</li>
<li>Launch “led.bas”</li>
<li>You should see a prompt requesting permission for SmallBASIC to
access the board. Click okay.</li>
<li>You should then see a toast message: IOIO board access
permitted.</li>
<li>For this initial setup “led.bas” has now timed out. You should be
able to re-launch “led.bas” for successful operation.</li>
</ul>
<p>You have to connect power to the board, because it will act as an
host and it will charge your Android device.</p>
<h2 id="examples">Examples</h2>
<h3 id="digital-output">Digital output</h3>
<h4 id="led">LED</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/led.bas">led.bas</a></p>
<p><img src="/images/ioio/ioioboard.png" /></p>
<h4 id="pwm">PWM</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/pwm.bas">pwm.bas</a></p>
<p><img src="/images/ioio/PWM.png" /></p>
<h4 id="hd44780-text-display">HD44780 text display</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/hd44780.bas">hd44780.bas</a></p>
<p><img src="/images/ioio/HD44780.png" /></p>
<h3 id="digital-input">Digital input</h3>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/button.bas">button.bas</a></p>
<p><img src="/images/ioio/button.png" /></p>
<h3 id="analog-input">Analog input</h3>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/slider-pot.bas">slider-pot.bas</a></p>
<p><img src="/images/ioio/SliderPot.png" /></p>
<h3 id="i2c">I2C</h3>
<h4 id="bh1750---ambient-light-sensor">BH1750 - Ambient light
sensor</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/bh1750.bas">bh1750.bas</a></p>
<p><img src="/images/ioio/BH1750.png" /></p>
<h4 id="bme280---temperature-and-humidity-sensor">BME280 - Temperature
and humidity sensor</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/bme280.bas">bme280.bas</a></p>
<p><img src="/images/ioio/BME280.png" /></p>
<h4
id="mpu6050---accelerometer-gyroscope-and-temperature-sensor">MPU6050 -
Accelerometer, gyroscope and temperature sensor</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/mpu6050.bas">mpu6050.bas</a></p>
<p><img src="/images/ioio/MPU6050.png" /></p>
<h4 id="veml6030---ambient-light-sensor">VEML6030 - Ambient-light
sensor</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/veml6030.bas">veml6030.bas</a></p>
<p><img src="/images/ioio/VEML6030.png" /></p>
<h4 id="ssd1306---oled-with-128x64-monochrome-pixels">SSD1306 - OLED
with 128x64 monochrome pixels</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/ssd1306.bas">ssd1306.bas</a></p>
<p><img src="/images/ioio/SSD1306.png" /></p>
<h3 id="spi">SPI</h3>
<h4 id="as---8x8-dot-matrix-module">1088AS - 8x8 dot matrix module</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/duino-1088as.bas">duino-1088as.bas</a></p>
<p><img src="/images/ioio/duino1088as.png" /></p>
<h4 id="st7789---tft-controller">ST7789 - TFT controller</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/st7789.bas">st7789.bas</a></p>
<p>SPI is too slow on IOIO to drive a TFT display.</p>
<h4 id="st7735---tft-controller">ST7735 - TFT controller</h4>
<p><a
href="https://github.com/smallbasic/smallbasic.plugins/blob/master/ioio/samples/st7735s.bas">st7735.bas</a></p>
<p>SPI is too slow on IOIO to drive a TFT display.</p>
</div>
<div class="pagefooter">
This page was last edited on Thu, 8 Aug 2024 22:03:08 +0200
|
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
</div>
</div>
</div>
</body>
</html>