rabbit-slide-hasumikin-RubyConfPoland2019-Workshop 2019.05.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rabbit +1 -0
- data/IoT-workshop-for-firmware-programming-with-ESP32-and-mrubyc.rab +558 -0
- data/README.rd +34 -0
- data/Rakefile +17 -0
- data/config.yaml +25 -0
- data/images/180425_mruby-c_fix_color_data-04.png +0 -0
- data/images/Corleto_thermistor1.jpg +0 -0
- data/images/LED-anatomy-1024x455.png +0 -0
- data/images/LED.jpg +0 -0
- data/images/LED.png +0 -0
- data/images/RWC2018-2.png +0 -0
- data/images/alexandru-zdrobau-176844-unsplash.jpg +0 -0
- data/images/andrew-santellan-311033-unsplash.jpg +0 -0
- data/images/annie-spratt-330560-unsplash.jpg +0 -0
- data/images/bb_wiring_01.png +0 -0
- data/images/beer-pouring-from-can-to-glass_925x.jpg +0 -0
- data/images/black-background.png +0 -0
- data/images/blinking_led_breadboard.png +0 -0
- data/images/bytecode.png +0 -0
- data/images/esp32_block_diagram-2.png +0 -0
- data/images/esp32_block_diagram.png +0 -0
- data/images/esp32_devboard.png +0 -0
- data/images/esp32_module.png +0 -0
- data/images/esp32_module_block_diagram.png +0 -0
- data/images/esp32_onechip.jpg +0 -0
- data/images/esp32_onechip.png +0 -0
- data/images/esp32_original.jpg +0 -0
- data/images/esp32_pcb_layout.png +0 -0
- data/images/hasumi.jpg +0 -0
- data/images/jj-ying-230105-unsplash.jpg +0 -0
- data/images/led_circuit.png +0 -0
- data/images/led_datasheet.png +0 -0
- data/images/m2.png +0 -0
- data/images/mark32.png +0 -0
- data/images/mark48.png +0 -0
- data/images/mark64.png +0 -0
- data/images/mcp3002.jpg +0 -0
- data/images/mnm-all-551345-unsplash.jpg +0 -0
- data/images/monstarlab.png +0 -0
- data/images/mruby_and_mrubyc-mruby.png +0 -0
- data/images/mruby_and_mrubyc-mrubyc.png +0 -0
- data/images/mruby_and_mrubyc.png +0 -0
- data/images/pdf/1.pdf +0 -0
- data/images/pdf/2.pdf +0 -0
- data/images/pdf/3.pdf +0 -0
- data/images/pdf/4.pdf +0 -0
- data/images/pdf/5.pdf +0 -0
- data/images/pdf/6.pdf +0 -0
- data/images/pdf/7.pdf +0 -0
- data/images/pdf/8.pdf +0 -0
- data/images/pdf/9.pdf +0 -0
- data/images/resistor.jpg +0 -0
- data/images/sorasak-252182-unsplash.jpg +0 -0
- data/images/thermistor.eps +2236 -0
- data/images/thermistor.jpg +0 -0
- data/images/thermistor.png +0 -0
- data/images/thermistor_approximation.eps +2271 -0
- data/images/thermistor_approximation.png +0 -0
- data/images/thermistor_breadboard.png +0 -0
- data/images/thermistor_circuit.png +0 -0
- data/images/thermistor_circuit_resistance.png +0 -0
- data/images/thermistor_datasheet.png +0 -0
- data/images/thermistor_resistance.eps +1330 -0
- data/images/thermistor_resistance.png +0 -0
- data/images/title_slide_background.png +0 -0
- data/images//346/235/276/346/261/237/345/237/216_Matsue.rb.jpg +0 -0
- data/pdf/RubyConfPoland2019-Workshop-IoT-workshop-for-firmware-programming-with-ESP32-and-mrubyc.pdf +0 -0
- data/theme.rb +89 -0
- data/workshops.md +16 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b405d2e727e9bdf9a97abafa789721d74b6745a8778e39c3f0eb67ce9062120f
|
4
|
+
data.tar.gz: d39e0fb8abf7e62826bbbaac065e06229efd7882fe96f3270dee51674b07219e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b4ed7960e3725d6d00ae33b9d1cf8f54d54dd31a01ef93109d06f08a04cf3cea575a854b2c0b52016b2cd02983217abfbe8f38b2e78d91caff82c062673085c5
|
7
|
+
data.tar.gz: cc059e8425cc13e5830883835d71ca8dc18209fcaba186f40500eac71509d9acd15b62d265d012be1cac9527caf7b2f3339775493ad14387756bcdee5ef3f879
|
data/.rabbit
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
IoT-workshop-for-firmware-programming-with-ESP32-and-mrubyc.rab
|
@@ -0,0 +1,558 @@
|
|
1
|
+
= IoT workshop for firmware programming with ESP32 and mruby/c
|
2
|
+
|
3
|
+
# サブタイトル
|
4
|
+
: author
|
5
|
+
HASUMI Hitoshi (@hasumikin)
|
6
|
+
: institution
|
7
|
+
Monstar Lab, Matsue
|
8
|
+
# : content-source
|
9
|
+
# イベント名
|
10
|
+
: date
|
11
|
+
March 16, 2019 in Matsue, Japan
|
12
|
+
: date
|
13
|
+
May 6, 2019 in Warszawa, Polska
|
14
|
+
: date
|
15
|
+
May 15, 2019 in Kraków, Polska
|
16
|
+
: allotted-time
|
17
|
+
3h
|
18
|
+
: theme
|
19
|
+
theme
|
20
|
+
|
21
|
+
= hide-title
|
22
|
+
(('tag:center'))\n\n\n\n((*(('tag:xx-large:Cześć!'))*))
|
23
|
+
== プロパティ
|
24
|
+
: hide-title
|
25
|
+
true
|
26
|
+
|
27
|
+
= about me
|
28
|
+
* HASUMI Hitoshi\n@hasumikin
|
29
|
+
* Ruby ((*💎*))\nSake 🍶\nSoba 🍜\nCoffee ☕
|
30
|
+
# image
|
31
|
+
# src = images/hasumi.jpg
|
32
|
+
# align = right
|
33
|
+
# relative-height = 80
|
34
|
+
|
35
|
+
= about me
|
36
|
+
== prop
|
37
|
+
: background-image
|
38
|
+
images/monstarlab.png
|
39
|
+
: background-image-relative-height
|
40
|
+
100
|
41
|
+
|
42
|
+
= about me
|
43
|
+
== prop
|
44
|
+
: background-image
|
45
|
+
images/m2.png
|
46
|
+
: background-image-relative-height
|
47
|
+
100
|
48
|
+
|
49
|
+
= about me
|
50
|
+
== prop
|
51
|
+
: background-image
|
52
|
+
images/松江城_Matsue.rb.jpg
|
53
|
+
: background-image-relative-width
|
54
|
+
100
|
55
|
+
|
56
|
+
= message from Matz
|
57
|
+
# # video
|
58
|
+
# # src = images/matz.mp4
|
59
|
+
|
60
|
+
= agenda
|
61
|
+
* we will learn how to start to make IoT product with Ruby
|
62
|
+
* assumed attendees are software programmers
|
63
|
+
* ESP32 microcontroller as the platform
|
64
|
+
* mruby/c (and C) as the firmware language
|
65
|
+
* we will iterate some combinations of lecture and hands-on
|
66
|
+
|
67
|
+
= agenda
|
68
|
+
* we have 3 to 4 hours 😨
|
69
|
+
* no worry, we will take several breaks
|
70
|
+
|
71
|
+
= break
|
72
|
+
\n\n\n(('tag:center'))a short break
|
73
|
+
== prop
|
74
|
+
: hide-title
|
75
|
+
true
|
76
|
+
: background-image
|
77
|
+
images/annie-spratt-330560-unsplash.jpg
|
78
|
+
: background-image-relative-height
|
79
|
+
100
|
80
|
+
|
81
|
+
= enquête
|
82
|
+
|
83
|
+
= enquête
|
84
|
+
(('tag:center'))\n\n\n\n✋ please raise your hand ✋\n✋ if you are a ✋\n✋ firmware programming ((*newbie*)) ✋
|
85
|
+
|
86
|
+
= enquête
|
87
|
+
(('tag:center'))\n\n\n\n✋ please raise your hand ✋\n✋ if you don't have ✋\n✋ ((*any*)) experience of mruby ✋
|
88
|
+
|
89
|
+
= enquête
|
90
|
+
(('tag:center'))\n\n\n\n✋ please raise your hand ✋\n✋ if you don't have ✋\n✋ ((*much*)) experience of C language ✋
|
91
|
+
|
92
|
+
= setup your laptop
|
93
|
+
* we have to install ESP-IDF and some dependent tools in order to develop mruby/c firmwares for ESP32
|
94
|
+
* the most important thing will be ((*USB*)). we will write our firmware into ESP32 through USB cable
|
95
|
+
|
96
|
+
= setup your laptop - Linux or macOS
|
97
|
+
* using ((*Linux distributions*)) or ((*macOS*)) (as a host machine) is the easiest way
|
98
|
+
* less USB problem
|
99
|
+
* I'm not sure but docker will not work because of USB problem
|
100
|
+
|
101
|
+
= setup your laptop - Windows
|
102
|
+
* you can choose both ((*Windows Subsystem for Linux*)) (WSL) and ((*MSYS2*))
|
103
|
+
* I recommend you to use WSL if your OS is Windows10 (64 bit) as compiling on WSL is much faster than MSYS2
|
104
|
+
* ((*WSL*))
|
105
|
+
* you should use WSL if your OS is 64bit of Win10 Pro
|
106
|
+
|
107
|
+
= setup your laptop - Windows
|
108
|
+
* ((*MSYS2*))
|
109
|
+
* strongly recommended of using zipped one which Espressif Systems maintenances
|
110
|
+
* besides, note that only 32 bit version of MSYS2 is available regardless of whether your Windows is 64 bit or 32 bit
|
111
|
+
* Docker for Windows
|
112
|
+
* it appears not to work so far
|
113
|
+
* but please tell me if it works
|
114
|
+
|
115
|
+
= setup your laptop - VM
|
116
|
+
* I (hasumi) use Linux Mint with VirtualBox on Windows 10 Professional
|
117
|
+
* but some people say that virtual environments tend to have problems around USB
|
118
|
+
|
119
|
+
= setup your laptop
|
120
|
+
\n\n
|
121
|
+
(('tag:center'))more information on
|
122
|
+
\n\n
|
123
|
+
https://github.com/hasumikin\n/IoT_workshop
|
124
|
+
|
125
|
+
= setup your laptop
|
126
|
+
\n\n\n\n
|
127
|
+
(('tag:center'))please tell me if you have any doubt
|
128
|
+
\n
|
129
|
+
during the hands-on
|
130
|
+
|
131
|
+
= Hands On 01
|
132
|
+
\n
|
133
|
+
(('tag:center'))Hello mruby/c World!
|
134
|
+
\n\n
|
135
|
+
open the URL
|
136
|
+
\n
|
137
|
+
(('tag:center'))github.com/hasumikin/IoT_workshop
|
138
|
+
\n\n
|
139
|
+
and find the link
|
140
|
+
\n
|
141
|
+
(('tag:center'))((*Hands on 01*))
|
142
|
+
== prop
|
143
|
+
: background-image
|
144
|
+
images/black-background.png
|
145
|
+
: background-image-relative-width
|
146
|
+
100
|
147
|
+
: background-image-relative-height
|
148
|
+
100
|
149
|
+
|
150
|
+
= what is microcontroller?
|
151
|
+
* if you are not familiar with microcontroller, this section is very important to grab overview what we do in this workshop
|
152
|
+
|
153
|
+
= one-chip microcontroller
|
154
|
+
* a single IC chip\nconsists of CPU(MPU),\nRAM, ROM and\nprogrammable GPIOs
|
155
|
+
* `programmable`\nmeans user can\nconfigure the role\nof the pins
|
156
|
+
|
157
|
+
# image
|
158
|
+
# src = images/esp32_onechip.png
|
159
|
+
# align = right
|
160
|
+
# relative-height = 90
|
161
|
+
|
162
|
+
= moduled microcontroller
|
163
|
+
* additional instruments\nlike WiFi communication\nmodule combined\nwith one-chip\nmicrocontroller
|
164
|
+
|
165
|
+
# image
|
166
|
+
# src = images/esp32_module.png
|
167
|
+
# align = right
|
168
|
+
# relative-height = 90
|
169
|
+
|
170
|
+
= moduled microcontroller
|
171
|
+
# image
|
172
|
+
# src = images/esp32_module_block_diagram.png
|
173
|
+
# align = center
|
174
|
+
# relative-height = 90
|
175
|
+
|
176
|
+
(('tag:left'))(('tag:xx-small:"esp32_hardware_design_guidelines_en.pdf esp32_datasheet_en.pdf"'))
|
177
|
+
|
178
|
+
= development board (devkit)
|
179
|
+
* useful equipments like\nUSB adaptor and power\nregulator combined\nwith microcontroller\nfor experimental work
|
180
|
+
* generally has 2.54mm\n(=1/10inch) pitch pins\nto be fit with\nbreadboard
|
181
|
+
|
182
|
+
# image
|
183
|
+
# src = images/esp32_devboard.png
|
184
|
+
# align = right
|
185
|
+
# relative-height = 90
|
186
|
+
|
187
|
+
= what is microcontroller?
|
188
|
+
* what we call as `microcontroller` depends on the situation
|
189
|
+
* I call the development board as `microcontroller` in this workshop
|
190
|
+
* you may have to treat `one-chip microcontroller` as `microcontroller` if you plan for producing an IoT hardware
|
191
|
+
|
192
|
+
= Hands On 02
|
193
|
+
\n
|
194
|
+
(('tag:center'))Hello ESP32 World!
|
195
|
+
\n\n
|
196
|
+
open the URL
|
197
|
+
\n
|
198
|
+
(('tag:center'))github.com/hasumikin/IoT_workshop
|
199
|
+
\n\n
|
200
|
+
and find the link
|
201
|
+
\n
|
202
|
+
(('tag:center'))((*Hands on 02*))
|
203
|
+
== prop
|
204
|
+
: background-image
|
205
|
+
images/black-background.png
|
206
|
+
: background-image-relative-width
|
207
|
+
100
|
208
|
+
: background-image-relative-height
|
209
|
+
100
|
210
|
+
|
211
|
+
= break
|
212
|
+
\n\n\n\n\n\n\n(('tag:center'))a short break
|
213
|
+
== prop
|
214
|
+
: hide-title
|
215
|
+
true
|
216
|
+
: background-image
|
217
|
+
images/andrew-santellan-311033-unsplash.jpg
|
218
|
+
: background-image-relative-height
|
219
|
+
100
|
220
|
+
|
221
|
+
= peripherals
|
222
|
+
* ((*peripheral*)) is an important concept of microcontroller
|
223
|
+
* high-end microcontroller has rich peripherals and low-end one has less
|
224
|
+
|
225
|
+
= peripherals
|
226
|
+
# image
|
227
|
+
# src = images/esp32_block_diagram-2.png
|
228
|
+
# align = center
|
229
|
+
# relative-height = 90
|
230
|
+
|
231
|
+
(('tag:center'))(('tag:xx-small:"esp32_datasheet_en.pdf"'))
|
232
|
+
|
233
|
+
= peripherals
|
234
|
+
* GPIO (General Purpose Input/Output)
|
235
|
+
* GPIO is a defining characteristic of microcontroller
|
236
|
+
* GPIO basically has values of only 0 and 1 (digital value)
|
237
|
+
* analog value will be mentioned later
|
238
|
+
* usecases of Input:
|
239
|
+
* switch as an user interface, getting sensor value
|
240
|
+
* usecases of Output:
|
241
|
+
* LED as a display, sending message to modem
|
242
|
+
|
243
|
+
= peripherals
|
244
|
+
* ADC (analog to digital converter) and\nDAC (vice versa)
|
245
|
+
* ADC converts analog value such as microphone input into digital value that computer can deal with
|
246
|
+
* DAC converts digital value such as sound data of MP3 into analog output in order to play back the music on loud speaker
|
247
|
+
|
248
|
+
= peripherals
|
249
|
+
* Raspberry Pi does neither have ADC nor DAC
|
250
|
+
* we can add an independent ADC part if we need it
|
251
|
+
# image
|
252
|
+
# src = images/mcp3002.jpg
|
253
|
+
# align = center
|
254
|
+
# relative-height = 90
|
255
|
+
|
256
|
+
(('tag:center'))(('tag:xx-small:from "http://akizukidenshi.com/catalog/g/gI-02584/"'))
|
257
|
+
|
258
|
+
= today's parts
|
259
|
+
* breadboard
|
260
|
+
* resistor
|
261
|
+
* LED
|
262
|
+
* thermistor
|
263
|
+
|
264
|
+
= breadboard (protoboard)
|
265
|
+
* wired internally by 2.54 mm pitch so that we can experiment without soldering
|
266
|
+
|
267
|
+
# image
|
268
|
+
# src = images/bb_wiring_01.png
|
269
|
+
# align = center
|
270
|
+
# relative-height = 90
|
271
|
+
|
272
|
+
(('tag:center'))(('tag:xx-small:from "https://ht-deko.com/arduino/breadboard.html"'))
|
273
|
+
|
274
|
+
= registor & Ohm's law
|
275
|
+
* if the voltage across the both ends of 10kOhm resistor is 3V, the current will be 0.3mA
|
276
|
+
|
277
|
+
(('tag:center'))3 / 10k = 3 / 10000 = 0.0003A = 0.3mA
|
278
|
+
|
279
|
+
# image
|
280
|
+
# src = images/resistor.jpg
|
281
|
+
# align = center
|
282
|
+
# relative-height = 100
|
283
|
+
|
284
|
+
= LED
|
285
|
+
# blockquote
|
286
|
+
# title = WIKIPEDIA
|
287
|
+
A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it.
|
288
|
+
|
289
|
+
# image
|
290
|
+
# src = images/LED.png
|
291
|
+
# align = center
|
292
|
+
# relative-height = 100
|
293
|
+
|
294
|
+
= LED - datasheet
|
295
|
+
# image
|
296
|
+
# src = images/led_datasheet.png
|
297
|
+
# align = center
|
298
|
+
# relative-height = 90
|
299
|
+
|
300
|
+
(('tag:center'))(('tag:xx-small:from "http://akizukidenshi.com/download/ds/optosupply/OSXXXX3Z74A_VER_A1.pdf"'))
|
301
|
+
|
302
|
+
= LED & Ohm's law
|
303
|
+
(('tag:center'))(3.3 - 2.1) / 330 = 0.0036A = 3.6mA
|
304
|
+
|
305
|
+
# image
|
306
|
+
# src = images/led_circuit.png
|
307
|
+
# align = center
|
308
|
+
# relative-height = 100
|
309
|
+
|
310
|
+
= LED & GPIO
|
311
|
+
* small LED can be lighten by GPIO
|
312
|
+
* but instruments like huge LED which requires high current can not be driven even if its nominal voltage is less than 3.3V
|
313
|
+
* because microcontroller has some limit of supplying amount of electric current
|
314
|
+
* incorrect usage may break your microcontroller
|
315
|
+
|
316
|
+
= Hands On 03
|
317
|
+
\n
|
318
|
+
(('tag:center'))Blinking LED
|
319
|
+
\n\n
|
320
|
+
open the URL
|
321
|
+
\n
|
322
|
+
github.com/hasumikin/IoT_workshop
|
323
|
+
\n\n
|
324
|
+
and find the link
|
325
|
+
\n
|
326
|
+
((*Hands on 03*))
|
327
|
+
\n\n
|
328
|
+
hint: you should use a ((*blue*)) resistor
|
329
|
+
== prop
|
330
|
+
: background-image
|
331
|
+
images/black-background.png
|
332
|
+
: background-image-relative-width
|
333
|
+
100
|
334
|
+
: background-image-relative-height
|
335
|
+
100
|
336
|
+
|
337
|
+
= break
|
338
|
+
\n\n\n\n\n(('tag:center'))a short break
|
339
|
+
== prop
|
340
|
+
: hide-title
|
341
|
+
true
|
342
|
+
: background-image
|
343
|
+
images/jj-ying-230105-unsplash.jpg
|
344
|
+
: background-image-relative-height
|
345
|
+
100
|
346
|
+
|
347
|
+
= today's parts (again)
|
348
|
+
* breadboard
|
349
|
+
* resistor
|
350
|
+
* LED
|
351
|
+
* thermistor
|
352
|
+
|
353
|
+
= thermistor
|
354
|
+
# blockquote
|
355
|
+
# title = WIKIPEDIA
|
356
|
+
A thermistor is a type of resistor whose resistance is dependent on temperature, more so than in standard resistors.
|
357
|
+
\n
|
358
|
+
# image
|
359
|
+
# src = images/thermistor.jpg
|
360
|
+
# align = center
|
361
|
+
# relative-height = 110
|
362
|
+
|
363
|
+
= thermistor
|
364
|
+
# image
|
365
|
+
# src = images/Corleto_thermistor1.jpg
|
366
|
+
# align = left
|
367
|
+
# relative-height = 90
|
368
|
+
|
369
|
+
(('tag:center'))(('tag:xx-small:from "https://www.allaboutcircuits.com/projects/measuring-temperature-with-an-ntc-thermistor/"'))
|
370
|
+
|
371
|
+
#= thermistor - approximation
|
372
|
+
# # LaTeX
|
373
|
+
#
|
374
|
+
# $\;$
|
375
|
+
#
|
376
|
+
# $R=R_{ref} \times e^{(B(\frac{1}{T+273}-\frac{1}{T_{o}+273}))}$
|
377
|
+
#
|
378
|
+
# hence,
|
379
|
+
#
|
380
|
+
# $T=\frac{1}{\frac{1}{B}\log \frac{R}{R_{ref}}+\frac{1}{T_{o}+273}}-273$
|
381
|
+
|
382
|
+
= thermistor - approximation
|
383
|
+
# image
|
384
|
+
# src = images/thermistor_approximation.png
|
385
|
+
# relative_width = 80
|
386
|
+
# relative_margin_top = 10
|
387
|
+
|
388
|
+
= thermistor - datasheet
|
389
|
+
# image
|
390
|
+
# src = images/thermistor_datasheet.png
|
391
|
+
# relative_width = 100
|
392
|
+
|
393
|
+
(('tag:center'))(('tag:xx-small:from "https://www.mouser.com/datasheet/2/362/semitec_atthermistor-1202913.pdf"'))
|
394
|
+
|
395
|
+
= thermistor - approximation
|
396
|
+
# enscript ruby
|
397
|
+
# this is CRuby
|
398
|
+
include Math
|
399
|
+
|
400
|
+
# according to the datasheet
|
401
|
+
B = 3_435 # from datasheet
|
402
|
+
To = 25 # from datasheet
|
403
|
+
Rref = 10_000 # arbitrary but fixed
|
404
|
+
|
405
|
+
def temperature(r)
|
406
|
+
1.to_f / ( 1.to_f / B * log(r.to_f / Rref)
|
407
|
+
+ 1.to_f / (To + 273) ) - 273
|
408
|
+
end
|
409
|
+
|
410
|
+
# if resistance of thermistor is 12kOhm
|
411
|
+
puts temperature(12_000)
|
412
|
+
|
413
|
+
=> 20.35988998853088
|
414
|
+
|
415
|
+
#= thermistor - circuit
|
416
|
+
# # LaTeX
|
417
|
+
#
|
418
|
+
# $R=\frac{V-V_{ref}}{\frac{V_{ref}}{R_{ref}}}$
|
419
|
+
|
420
|
+
= thermistor & Ohm's law
|
421
|
+
# image
|
422
|
+
# src = images/thermistor_circuit_resistance.png
|
423
|
+
# relative-height = 100
|
424
|
+
|
425
|
+
= Hands On 04
|
426
|
+
\n
|
427
|
+
(('tag:center'))Taking temperature
|
428
|
+
\n\n
|
429
|
+
open the URL
|
430
|
+
\n
|
431
|
+
github.com/hasumikin/IoT_workshop
|
432
|
+
\n\n
|
433
|
+
and find the link
|
434
|
+
\n
|
435
|
+
((*Hands on 04*))
|
436
|
+
\n\n
|
437
|
+
hint: you should use a ((*brown*)) resistor
|
438
|
+
== prop
|
439
|
+
: background-image
|
440
|
+
images/black-background.png
|
441
|
+
: background-image-relative-width
|
442
|
+
100
|
443
|
+
: background-image-relative-height
|
444
|
+
100
|
445
|
+
|
446
|
+
= break
|
447
|
+
\n\n\n\n\n\n(('tag:center'))a short break
|
448
|
+
== prop
|
449
|
+
: hide-title
|
450
|
+
true
|
451
|
+
: background-image
|
452
|
+
images/mnm-all-551345-unsplash.jpg
|
453
|
+
: background-image-relative-height
|
454
|
+
100
|
455
|
+
|
456
|
+
= what is mruby/c?
|
457
|
+
* github.com/mrubyc/mrubyc
|
458
|
+
* yet another implementation of mruby
|
459
|
+
* `/c` symbolizes compact,\nconcurrent and capability
|
460
|
+
* especially dedicated to\none-chip microcontroller
|
461
|
+
|
462
|
+
= mruby and mruby/c
|
463
|
+
# RT
|
464
|
+
|
465
|
+
mruby, mruby/c
|
466
|
+
|
467
|
+
v1.0.0 in Jan 2014, v1.0 in Jan 2017
|
468
|
+
for general embedded software, for one-chip microcontroller
|
469
|
+
RAM < 400KB, RAM < 40KB
|
470
|
+
|
471
|
+
* sometimes mruby is still too big to run on microcontroller
|
472
|
+
|
473
|
+
= ((*both*)) mruby and mruby/c
|
474
|
+
* bytecodes are compiled by `mrbc` and VM executes the bytecode
|
475
|
+
# image
|
476
|
+
# src = images/mruby_and_mrubyc.png
|
477
|
+
# align = center
|
478
|
+
# relative-height = 100
|
479
|
+
|
480
|
+
= bytecode
|
481
|
+
* a kind of intermediate representation
|
482
|
+
* virtual machine dynamically interprets the bytecode and processes the program
|
483
|
+
# image
|
484
|
+
# src = images/bytecode.png
|
485
|
+
# align = center
|
486
|
+
# relative-width = 100
|
487
|
+
|
488
|
+
= mruby on microcontroller
|
489
|
+
* RTOS (Real-Time OS) manages mruby VMs. RTOS has features like multi tasking
|
490
|
+
# image
|
491
|
+
# src = images/mruby_and_mrubyc-mruby.png
|
492
|
+
# align = center
|
493
|
+
# relative-height = 100
|
494
|
+
|
495
|
+
= mruby/c on microcontroller
|
496
|
+
* mruby/c has its own mechanism to manage the runtime: ((*rrt0*))
|
497
|
+
# image
|
498
|
+
# src = images/mruby_and_mrubyc-mrubyc.png
|
499
|
+
# align = center
|
500
|
+
# relative-height = 100
|
501
|
+
|
502
|
+
= mruby/c - virtual machine (VM)
|
503
|
+
* much smaller than mruby's one
|
504
|
+
* that's why mruby/c runs on smaller RAM
|
505
|
+
* accordingly, mruby/c has ((*less*)) functionality than mruby
|
506
|
+
|
507
|
+
= how ((*less*))?
|
508
|
+
|
509
|
+
= how ((*less*))? - for example
|
510
|
+
* mruby/c doesn't have module, hence there is no Kernel module
|
511
|
+
* then you must wonder how can you `#puts`?
|
512
|
+
* in mruby/c, `#puts` is implemented in Object class
|
513
|
+
|
514
|
+
= how ((*less*))? - for example
|
515
|
+
* mruby/c doesn't have #send, #eval, nor #method_missing
|
516
|
+
* moreover, mruby/c neither have your favorite features like TracePoint nor Refinements 😞
|
517
|
+
|
518
|
+
= how ((*less*))? - actually
|
519
|
+
* the full list of mruby/c's classes
|
520
|
+
* Array, FalseClass, Fixnum, Float, Hash, Math, Mutex, NilClass, Numeric, Object, Proc, Range, String, Symbol, TrueClass, VM
|
521
|
+
|
522
|
+
= despite the fact,
|
523
|
+
* no problem in practical use of microcontroller
|
524
|
+
* as far as IoT go, mruby/c is enough Ruby as I expect
|
525
|
+
* we can fully develop firmwares with features of mruby/c
|
526
|
+
|
527
|
+
= Hands On 05
|
528
|
+
\n
|
529
|
+
(('tag:center'))Multi-tasking with mruby/c
|
530
|
+
\n\n
|
531
|
+
open the URL
|
532
|
+
\n
|
533
|
+
(('tag:center'))github.com/hasumikin/IoT_workshop
|
534
|
+
\n\n
|
535
|
+
and find the link
|
536
|
+
\n
|
537
|
+
(('tag:center'))((*Hands on 05*))
|
538
|
+
== prop
|
539
|
+
: background-image
|
540
|
+
images/black-background.png
|
541
|
+
: background-image-relative-width
|
542
|
+
100
|
543
|
+
: background-image-relative-height
|
544
|
+
100
|
545
|
+
|
546
|
+
= conclusion
|
547
|
+
|
548
|
+
= conclusion
|
549
|
+
\n\n\n\n
|
550
|
+
(('tag:center'))(('tag:large:All you need is')) ((*(('tag:large:Ohm's law'))*))
|
551
|
+
|
552
|
+
= ((' '))
|
553
|
+
\n\n\n\n
|
554
|
+
(('tag:center'))(('tag:xx-large:Thank you!'))
|
555
|
+
== プロパティ
|
556
|
+
: hide-title
|
557
|
+
true
|
558
|
+
|