rabbit-slide-hasumikin-RubyConfTH2023 2022.09.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a879849dc9c36b2c30364f9a860719a44ef68045b386b1962bcf5ee10c1f90ed
4
+ data.tar.gz: '08f8bb1e0ed31c1906f8c909123a443b76d0f049dfcbd5c8a4d46afb01af0d05'
5
+ SHA512:
6
+ metadata.gz: 6becd22ab4a368d73095218066341ca2f0b38c933e92671f35193c01170c7274a711e733e72be4b218759458b84ed7c5cdc63bd9c4b58e5593d974605973088f
7
+ data.tar.gz: 1915ee5370451da25d97e48bf9b0c8676c14ec59f046e41554d0e45a44230fe98b572aa6e030a0b773de0844e71125ff1419c52b5d29771946aacbe69bf03540
data/.rabbit ADDED
@@ -0,0 +1 @@
1
+ ABeginnersCompleteGuideToMicrocontrollerProgrammingWithRuby.rab
@@ -0,0 +1,616 @@
1
+ = A Beginner's Complete Guide to Microcontroller Programming with Ruby
2
+
3
+ : author
4
+ hasumikin
5
+ : place
6
+ Bangkok, Thailand
7
+ : date
8
+ October 6th - 7th 2023
9
+ : allotted-time
10
+ 30m
11
+ : theme
12
+ theme
13
+
14
+ = Today's content
15
+ (('tag:center'))
16
+ (('tag:x-small:Part 1'))\n
17
+ Preparation
18
+ \n\n
19
+ (('tag:x-small:Part 2'))\n
20
+ Getting Started with Microcontroller
21
+ \n\n
22
+ (('tag:x-small:Part 3'))\n
23
+ Exploring PicoRuby Further
24
+ \n\n
25
+ (('tag:x-small:Part 4'))\n
26
+ PicoRuby Under the Hood
27
+ == prop
28
+ : hide-title
29
+ true
30
+
31
+ = self.inspect
32
+
33
+ * Hitoshi HASUMI
34
+ * hasumikin (('tag:small:(GitHub, ex-Twitter, Bluesky and Threads)'))
35
+ * Creator of PicoRuby and PRK Firmware
36
+ * Committer of CRuby's IRB and Reline
37
+ * First prize of Fukuoka Ruby Award\n(2020 and 2022✌️)
38
+ * A final nominee of Ruby Prize 2021
39
+
40
+ # image
41
+ # src = images/hasumi.jpg
42
+ # align = right
43
+ # relative-height = 95
44
+ # relative_margin_top = 50
45
+ # relative_margin_left = 25
46
+
47
+ = chapter
48
+ Part 1\n
49
+ (('tag:xx-large:Preparation'))
50
+ == prop
51
+ : hide-title
52
+ true
53
+
54
+ = Setup (minimal)
55
+ * Raspberry Pi Pico
56
+ * Or other ((*RP2040*))-based controller
57
+ * USB cable
58
+ * Terminal emulator on laptop
59
+
60
+ # image
61
+ # src = images/rpi_pico.jpg
62
+ # align = right
63
+ # relative-height = 95
64
+ # relative_margin_top = 0
65
+ # relative_margin_left = 0
66
+ # draw0 = [rectangle, false, 0.3, 0.41, 0.37, 0.2, {color: red, line_width: 8}]
67
+ # draw1 = [text, RP2040, 0.12, 0.61, {color: red, size: 70, font_family: 'Courier Prime', weight: bold}]
68
+
69
+ = Raspberry Pi Pico
70
+ * Raspberry Pi Pico: Microcontroller board
71
+ * MCU: RP2040
72
+ * Cortex-Mzero+ (dual)
73
+ * 264 KB RAM
74
+ * 2 MB flash ROM
75
+ * It generally runs without an OS (bere metal)
76
+ * ref) Raspberry Pi: Single-board computer
77
+ * It generally needs an OS like Raspberry Pi OS or Windows for Arm
78
+
79
+ = Terminal emulator
80
+ * Linux -> GTKTerm👍
81
+ * Windows -> Tera Term🙆
82
+ * macOS -> PuTTY (I'm not sure)
83
+ * Traditional CUI/TUI tools may have CR/LF trouble
84
+ * cu
85
+ * screen
86
+ * minicom
87
+
88
+ = Let's begin 1/4
89
+ * Download the latest\n`R2P2-*.(zip|gz)`\nfrom GitHub\nthen unzip it into\n`R2P2-*.uf2`
90
+
91
+ # image
92
+ # align = right
93
+ # src = images/download-r2p2.png
94
+ # relative-height = 90
95
+ # relative_margin_left = 20
96
+ # relative_margin_top = 0
97
+
98
+ (('tag:x-small'))\n\n\n
99
+ github.com/picoruby/R2P2/releases
100
+
101
+ = Let's begin 2/4
102
+ * Connect Pi Pico and PC while\npressing the BOOTSEL button
103
+ * You'll find "RPI-RP2" drive\nin file manager
104
+
105
+ # image
106
+ # align = right
107
+ # src = images/boot_button_1.png
108
+ # relative-height = 80
109
+ # relative_margin_left = 20
110
+ # relative_margin_top = -2
111
+
112
+ (('tag:right'))
113
+ (('tag:xx-small'))\n\n\n\n\n\n\n\n\n\n\n
114
+ https://www.raspberrypi.org/documentation/rp2040/getting-started
115
+
116
+ = Let's begin 3/4
117
+
118
+ * Drag & drop `R2P2-*.uf2` into RPI-RP2 drive
119
+
120
+ # image
121
+ # align = bottom
122
+ # src = images/install-uf2.png
123
+ # relative-height = 90
124
+ # relative_margin_left = 0
125
+ # relative_margin_top = 1
126
+
127
+ = Let's begin 4/4
128
+ * Open a proper\nserial port on\nterminal emulator
129
+
130
+ # image
131
+ # align = right
132
+ # src = images/teraterm-0.png
133
+ # relative-height = 90
134
+ # relative_margin_left = 22
135
+ # relative_margin_top = 0
136
+
137
+ = R2P2 Shell should start [Demo]
138
+ * Unix-like shell running on Raspberry Pi Pico
139
+ * You can use some\ncommands like `pwd`, `cd`,\n`ls`, `mkdir`
140
+ * It apparently has a\nfilesystem\n(written in Ruby!)
141
+
142
+ # image
143
+ # align = right
144
+ # src = images/teraterm.png
145
+ # relative-height = 75
146
+ # relative_margin_left = 28
147
+ # relative_margin_top = 5
148
+
149
+ = PicoIRB [Demo]
150
+ * PicoRuby's IRB is running within the R2P2 shell on Raspberry Pi Pico
151
+ * Your Ruby snippet is going to be compiled into mruby VM code and executed ((*on the fly*))
152
+ * It means PicoRuby contains an mruby compiler which can run on a one-chip microcontroller (will be mentioned later)
153
+
154
+ = chapter
155
+ Part 2\n
156
+ (('tag:xx-large:Getting Started with Microcontroller'))
157
+ == prop
158
+ : hide-title
159
+ true
160
+
161
+ = GPIO (General Purpose Input/Output)
162
+ * Fundamental digital I/O
163
+ * Variety of uses:
164
+ * Input: Detects on-off state of switch and button
165
+ * Output: Makes a voltage
166
+ * You can even implement a communication protocol by controlling GPIO in milli/micro sec
167
+
168
+ = GPIO --- Blinking LED [Demo]
169
+ irb> led = GPIO.new(25, GPIO::OUT)
170
+ irb> 3.times do
171
+ irb* led.write 1
172
+ irb* sleep 1
173
+ irb* led.write 0
174
+ irb* sleep 1
175
+ irb* end
176
+
177
+ (('tag:small'))
178
+ (('tag:center'))
179
+ GPIO25 internally connects to on-board LED\nthrough a resistor
180
+
181
+ = GPIO --- Blinking LED by discrete parts
182
+ * Parts list:
183
+ * LED (RED)
184
+ * Resistor (1kΩ)
185
+
186
+ # image
187
+ # align = right
188
+ # src = images/rp2-resistor-led_bb.png
189
+ # relative-height = 90
190
+ # relative_margin_left = 10
191
+ # relative_margin_top = 0
192
+
193
+ = GPIO --- Blinking LED by discrete parts
194
+ irb> pin = GPIO.new(15, GPIO::OUT)
195
+
196
+ # image
197
+ # align = bottom
198
+ # src = images/rp2-resistor-led_bb.png
199
+ # relative-height = 100
200
+ # relative_margin_left = 0
201
+ # relative_margin_top = 0
202
+
203
+ = GPIO --- Blinking LED by discrete parts
204
+ GPIO15 ===> 1kΩ ===> LED ===> GND
205
+ <----- 1.5V -----><--- 1.8V ---->
206
+ <------------ 3.3V ------------->
207
+ * RP2040's logic level: 3.3V
208
+ * LED voltage drop: ((*1.8V*))\n(according to LED's datasheet)
209
+ * Current: (3.3V - 1.8V) / 1kΩ = ((*1.5mA*))\n(calculated by Ohm's Law)
210
+
211
+ # image
212
+ # align = right
213
+ # src = images/rp2-resistor-led_schem.png
214
+ # relative-height = 100
215
+ # relative_margin_left = 5
216
+ # relative_margin_top = 0
217
+
218
+ = 🏫Study time: Electromagnetism | Physics
219
+ * Ohm's Law
220
+ * V = I * R ⇔ I = V / R ⇔ R = V / I
221
+ * Kirchhoff's Circuit Laws
222
+ * Current law: The algebraic sum of currents in a network of conductors meeting at a point is zero
223
+ * Voltage law: The directed sum of the potential differences (voltages) around any closed loop is zero
224
+
225
+ = ADC (Analog to Digital Converter)
226
+ * ADC handles values from 0 to logic-level by converting an analog voltage to a digital value
227
+ * e.g. RP2040's ADC has ((*12 bits*)) depth and accordingly takes a raw value from ((*0 (0 V)*)) to ((*4095 (3.3 V)*))
228
+ * Typical usage:
229
+ * Temperature sensor🌡
230
+ * Joystick🕹
231
+
232
+ = ADC --- Temperature [Demo]
233
+ irb> require 'adc'
234
+ irb> adc = ADC.new(:temperature)
235
+ irb> adc.read_raw
236
+ irb> while true
237
+ irb* voltage = adc.read_voltage
238
+ irb* puts 27 - (voltage - 0.706) / 0.001721
239
+ irb* sleep 1
240
+ irb* end
241
+
242
+ (('tag:center'))
243
+ RP2040 has an in-chip temperature sensor that connects to an ADC channel
244
+
245
+ = ADC --- Temperature by discrete parts
246
+ * Parts list:
247
+ * Resistor
248
+ * Rref: 10kΩ
249
+ * Thermistor
250
+ * 10kΩ (at 25℃ = 298.15K)
251
+ * B const: 3950
252
+ * T0: 298.15 (kelvin)
253
+
254
+ # image
255
+ # align = right
256
+ # src = images/rp2-resistor-thermistor_bb.png
257
+ # relative-height = 90
258
+ # relative_margin_left = 18
259
+ # relative_margin_top = 0
260
+
261
+ = ADC --- Temperature by discrete parts
262
+ * Parts list:
263
+ * Resistor
264
+ * Rref: 10kΩ
265
+ * Thermistor
266
+ * 10kΩ (at 25℃ = 298.15K)
267
+ * B const: 3950
268
+ * T0: 298.15 (kelvin)
269
+
270
+ # image
271
+ # align = right
272
+ # src = images/rp2-resistor-thermistor_schem.png
273
+ # relative-height = 90
274
+ # relative_margin_left = -10
275
+ # relative_margin_top = 0
276
+
277
+ = ADC --- Temperature by discrete parts
278
+ irb> require 'adc'
279
+ irb> Rref = 10000.0
280
+ irb> B = 3950.0
281
+ irb> T0 = 298.15
282
+ irb> def kelvin_temp(rth)
283
+ irb* temp_inverse = 1 / B * Math.log(rth / Rref) + (1 / T0)
284
+ irb* 1 / temp_inverse
285
+ irb* end
286
+ irb> rth = (3.3 / adc.read_voltage - 1) * Rref
287
+ irb> puts "#{kelvin_temp(rth) - 273.15} C"
288
+ => 28.1234 C
289
+
290
+ = chapter
291
+ Part 3\n
292
+ (('tag:xx-large:Exploring PicoRuby Further'))
293
+ == prop
294
+ : hide-title
295
+ true
296
+
297
+ = PicoRuby applications
298
+ * R2P2
299
+ * Unix-like shell system written in PicoRuby
300
+ * You may want to say an Operating System in Ruby
301
+ * PRK Firmware
302
+ * Keyboard firmware framework for DIY keyboard
303
+ * You can write your keymap and keyboard's behavior with Ruby
304
+
305
+ = R2P2 (again)
306
+ * IRB
307
+ * Multiple-line editor
308
+ * Built-in commands and executables (all written in Ruby)
309
+ * You can write your own external command
310
+
311
+ = Executables in R2P2
312
+ # enscript ruby
313
+ # date
314
+ puts Time.now.to_s
315
+
316
+ # mkdir
317
+ Dir.mkdir(ARGV[0])
318
+
319
+ = Write a Ruby script file [Demo]
320
+ # enscript sh
321
+ $> vim hello.rb
322
+
323
+ (('tag:center'))Edit the file and save it.
324
+
325
+ # enscript ruby
326
+ puts "Hello World!"
327
+
328
+ (('tag:center'))Then run it.
329
+
330
+ # enscript sh
331
+ $> ./hello.rb
332
+
333
+ = Or just drag and drop [Demo]
334
+
335
+ # image
336
+ # align = bottom
337
+ # src = images/drag-and-drop.png
338
+ # relative-height = 90
339
+ # relative_margin_left = 0
340
+ # relative_margin_top = 3
341
+
342
+ = GPIO and ADC work together [Demo]
343
+ # enscript ruby
344
+ require 'adc'
345
+ def calc_temp(volt)
346
+ 27 - (volt - 0.706) / 0.001721
347
+ end
348
+ adc = ADC.new(:temperature)
349
+ led = GPIO.new(25, GPIO::OUT)
350
+ while true
351
+ temp = calc_temp(adc.read_voltage)
352
+ puts "temp: #{temp} C"
353
+ led.write(30 < temp ? 1 : 0)
354
+ sleep 1
355
+ end
356
+
357
+ = R2P2 [Demo]
358
+ * `/home/app.rb` automatically runs on start up
359
+
360
+ # enscript ruby
361
+ # You can stop by Ctrl-C
362
+ led = GPIO.new(25, GPIO::OUT)
363
+ while true
364
+ led.write 1
365
+ puts "Hello World!"
366
+ sleep 1
367
+ led.write 0
368
+ sleep 1
369
+ end
370
+
371
+ = BTW,
372
+ \n\n
373
+ R2P2 stands for
374
+ \n\n
375
+ (('tag:large:((*R*))uby on ((*R*))aspberry ((*P*))i ((*P*))ico'))
376
+
377
+ # image
378
+ # align = right
379
+ # src = images/R2D2_mosaic.png
380
+ # relative-height = 90
381
+ # relative_margin_left = 10
382
+ # relative_margin_top = 0
383
+
384
+ = [FYI] Serial communication protocols
385
+ * SPI: High speed, full duplex. e.g. Acceleration sensor, Color display, etc.
386
+ * I2C: Low speed, Addressing network with fewer wires. e.g. RTC, Temperature sensor and Charactor display, etc.
387
+ * UART: Buffered asyncronous communication. e.g. Terminal emulator, Wireless module like BLE and LTE/5G, etc.
388
+
389
+ = [FYI] I2C and UART
390
+ * Example of I2C (RTC)\nand UART (USB serial)
391
+ * Watch the demo video\nin README.md
392
+ * It's also an example of\nhow to build your own app
393
+
394
+ (('tag:center'))
395
+ \n\n
396
+ github.com/picoruby/rp2040-peripheral-demo
397
+
398
+ # image
399
+ # align = right
400
+ # src = images/rp2040-peripheral-demo_bb-trim.png
401
+ # relative-height = 80
402
+ # relative_margin_left = 45
403
+ # relative_margin_top = -5
404
+
405
+ = [FYI] I2C and UART
406
+ * Parts list:
407
+ * PCF8523 RTC module
408
+ * FTDI USB to TTL Serial\nAdapter Cable (3.3V)
409
+
410
+ # image
411
+ # align = right
412
+ # src = images/rp2040-peripheral-demo_bb-trim.png
413
+ # relative-height = 90
414
+ # relative_margin_left = 33
415
+ # relative_margin_top = 0
416
+
417
+ = PRK Firmware - Corne (CRKBD)
418
+ # image
419
+ # src = images/crkbd_2.jpg
420
+ # relative_height = 95
421
+
422
+ = PRK Firmware - Meishi2 (4-keys pad)
423
+ # enscript ruby
424
+ require "consumer_key"
425
+ kbd = Keyboard.new
426
+ kbd.init_pins(
427
+ [ 6, 7 ], # row0, row1
428
+ [ 28, 27 ] # col0, col1
429
+ )
430
+ kbd.add_layer :default, %i[ ZERO_RAISE KC_1 KC_2 KC_3 ]
431
+ kbd.define_mode_key :ZERO_RAISE, [ :KC_0, :raise, 200, 200 ]
432
+ kbd.add_layer :raise, %i[ ZERO_RAISE
433
+ KC_AUDIO_VOL_UP
434
+ KC_AUDIO_VOL_DOWN
435
+ KC_AUDIO_MUTE ]
436
+ kbd.start!
437
+
438
+ = chapter
439
+ Part 4\n
440
+ (('tag:xx-large:PicoRuby Under the Hood'))
441
+ == prop
442
+ : hide-title
443
+ true
444
+
445
+ = mruby and PicoRuby
446
+ * mruby
447
+ * General purpose embedded Ruby implementation written by Matz
448
+ * PicoRuby (PicoRuby compiler + mruby/c VM)
449
+ * Another implementation of murby targeting on one-chip microcontroller (((*smaller foot print*)))
450
+ * The VM code specifications are common to both
451
+ * So the compilers are interchangeable
452
+
453
+ = Small foot print
454
+
455
+ # enscript sh
456
+ $ valgrind \
457
+ --tool=massif \
458
+ --stacks=yes \
459
+ path/to/(mruby|picoruby) \
460
+ -e 'puts "Hello World!"'
461
+
462
+ (('tag:center'))`massif.out.[pid]` file will be created. Then,
463
+
464
+ $ ms_print massif.out.1234 | less
465
+
466
+ = Small foot print
467
+
468
+ --------------------------------------------------------------------------------
469
+ Command: mruby -e 'puts "Hello World!"'
470
+ Massif arguments: --stacks=yes
471
+ ms_print arguments: massif.out.18391
472
+ --------------------------------------------------------------------------------
473
+ KB
474
+ 133.5^ #
475
+ | #
476
+ | #
477
+ | #
478
+ | #
479
+ | #
480
+ | #
481
+ | #
482
+ | @ :@:::@:#:
483
+ | @:@@@::::@:::@:#::
484
+ | ::@::::::@::::::::@:@@@::::@:::@:#::
485
+ | @:::::::::@@::::@:::@::::::@:::::: :@:@@@::::@:::@:#::
486
+ | @@@:::@:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
487
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
488
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
489
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
490
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
491
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
492
+ | @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
493
+ | @ @ :: @:::::::::@ :: :@:::@::::::@:::::: :@:@@@::::@:::@:#::
494
+ 0 +----------------------------------------------------------------------->Mi
495
+ 0 1.281
496
+ # Note: Measured in 64 bit Ubuntu
497
+
498
+ = Small foot print
499
+
500
+ --------------------------------------------------------------------------------
501
+ Command: picoruby -e 'puts "Hello World!"'
502
+ Massif arguments: --stacks=yes
503
+ ms_print arguments: massif.out.21752
504
+ --------------------------------------------------------------------------------
505
+ KB
506
+ 9.820^ #
507
+ | @:#:::
508
+ | @:#:::::
509
+ | @:#:::::
510
+ | @:#:::::
511
+ | @ @:#:::::
512
+ | @ @:#:::::
513
+ | @ : @:#:::::
514
+ | @ ::: @:#:::::
515
+ | @ : ::: @:#:::::
516
+ | @ ::@::::@:#:::::@
517
+ | @ ::@::::@:#:::::@
518
+ | @: :::::@::::@:#:::::@
519
+ | @::: :: :::@::::@:#:::::@
520
+ | @:: ::: :::@::::@:#:::::@
521
+ | @:: : ::: :::@::::@:#:::::@
522
+ | @:: : ::: :::@::::@:#:::::@
523
+ | :@:: : : :: :@:@: : :@@: ::@::::: ::: :::@::::@:#:::::@
524
+ | :@:: :::::::::::::::@:@:@:::::@ ::: @:: : :::: :::@::::@:#:::::@
525
+ |::::::@::@:: ::: ::: :::::@:@:@:: ::@ : : @:: : :::: :::@::::@:#:::::@
526
+ 0 +----------------------------------------------------------------------->ki
527
+ 0 324.5
528
+ # Note: Measured in 64 bit Ubuntu
529
+
530
+ = Small foot print
531
+ * RAM consumption of `puts "Hello World!"`
532
+ * mruby: 133.5 KB (on 64 bit)
533
+ * PicoRuby: 9.82 KB (on 64 bit)
534
+ * RP2040 (32 bit) has 264 KB RAM
535
+ * Only small applications running with mruby works
536
+ * Big apps like R2P2 and PRK Firmware should be written in PicoRuby
537
+
538
+ = PicoRuby ecosystem
539
+ * Picogems
540
+ * PRK Firmware is also a Picogem
541
+ * Peripheral gems
542
+ * picoruby-gpio
543
+ * picoruby-adc
544
+ * picoruby-i2c
545
+ * picoruby-spi
546
+ * picoruby-uart
547
+ * Peripheral interface guide
548
+ * https://github.com/mruby/microcontroller-peripheral-interface-guide
549
+
550
+ # image
551
+ # src = images/QR_github-com-peripheral-interface-guide.png
552
+ # align = right
553
+ # relative-height = 70
554
+ # relative_margin_top = 0
555
+ # relative_margin_left = 18
556
+
557
+ = PicoRuby ecosystem
558
+ * Build system forked from mruby
559
+ * You can build your application in a similar way to mruby
560
+ * You can also write your gem and host it on your GitHub
561
+ * RP2040 is the only target as of now. So,
562
+ * You can port PicoRuby (Picogems) to other microcontrollers
563
+
564
+ = Restrictions of PicoRuby
565
+ * Minimum built-in classes and methods
566
+ * Doesn't support some syntax like heredoc and numbered parameters
567
+ * No meta-programming features
568
+ * No strict distinction between instance methods and singleton methods
569
+ * Some bugs (because I'm lazy🥺).\nSee github.com/picoruby/picoruby/issues
570
+
571
+ = Conclusion
572
+ * PicoRuby is a Ruby implementaiton targeting on one-chip microcontroller
573
+ * Essential peripheral libraries: GPIO, ADC, I2C, SPI, and UART are ready
574
+ * You can develop your microcontroller application step by step using the R2P2 and IRB
575
+ * You need only R2P2 to write small applications
576
+ * Future work:
577
+ * Bluetooth for "Raspberry Pi Pico ((*W*))" (soon🤞)
578
+
579
+ = RubyKaigi 2024 [AD]
580
+ # image
581
+ # src = images/okinawa.jpg
582
+ # align = center
583
+ # relative-height = 140
584
+ # relative_margin_top = -10
585
+ # relative_margin_left = 0
586
+ # draw1 = [text, RubyKaigi 2024, 0.10, 0.15, {color: white, size: 100, font_family: 'Montserrat', weight: bold}]
587
+ # draw2 = [text, "[ad]", 0.60, 0.21, {color: white, size: 30, font_family: 'Montserrat', weight: normal}]
588
+ # draw3 = [text, "In Okinawa🏝️ May 15th - 17th ", 0.10, 0.26, {color: white, size: 60, font_family: 'Montserrat', weight: normal}]
589
+ # draw4 = [text, "1000+ attendees, tons of tech talks", 0.10, 0.33, {color: white, size: 60, font_family: 'Montserrat', weight: normal}]
590
+ # draw5 = [text, "All Japanese talks come with simultaneous interpretation into English", 0.10, 0.40, {color: white, size: 35, font_family: 'Montserrat', weight: normal}]
591
+ # draw6 = [text, "Various parties🍻", 0.10, 0.47, {color: white, size: 60, font_family: 'Montserrat', weight: normal}]
592
+ # draw7 = [text, https://098free.com/photos/14262/, 0.68, 0.78, {color: white, size: 22, font_family: 'Montserrat', weight: normal}]
593
+
594
+ == prop
595
+ : hide-title
596
+ true
597
+
598
+ = That's all! Visit repos and stargaze🌟
599
+
600
+ (('tag:small'))
601
+ \n\n
602
+ github.com/picoruby/picoruby
603
+ \n\n
604
+ github.com/picoruby/R2P2
605
+ \n\n
606
+ github.com/picoruby/prk_firmware
607
+ \n\n
608
+ github.com/picoruby/rp2040-peripheral-demo
609
+
610
+ # image
611
+ # src = images/QR_github-com-picoruby.png
612
+ # align = right
613
+ # relative-height = 65
614
+ # relative_margin_top = -10
615
+ # relative_margin_left = 18
616
+
data/README.rd ADDED
@@ -0,0 +1,24 @@
1
+ = A Beginner's Complete Guide to Microcontroller Programming with Ruby
2
+
3
+ Presentation slide for RubyConfTH 2023
4
+
5
+ == For author
6
+
7
+ === Show
8
+
9
+ rake
10
+
11
+ === Publish
12
+
13
+ rake publish
14
+
15
+ == For viewers
16
+
17
+ === Install
18
+
19
+ gem install rabbit-slide-hasumikin-RubyConfTH2023
20
+
21
+ === Show
22
+
23
+ rabbit rabbit-slide-hasumikin-RubyConfTH2023.gem
24
+
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require "rabbit/task/slide"
2
+
3
+ # Edit ./config.yaml to customize meta data
4
+
5
+ spec = nil
6
+ Rabbit::Task::Slide.new do |task|
7
+ spec = task.spec
8
+ # spec.files += Dir.glob("doc/**/*.*")
9
+ # spec.files -= Dir.glob("private/**/*.*")
10
+ # spec.add_runtime_dependency("rabbit-theme-YOUR-THEME")
11
+ end
12
+
13
+ desc "Tag #{spec.version}"
14
+ task :tag do
15
+ sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
16
+ sh("git", "push", "--tags")
17
+ end
data/config.yaml ADDED
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: RubyConfTH2023
3
+ base_name: ABeginnersCompleteGuideToMicrocontrollerProgrammingWithRuby.rab
4
+ tags:
5
+ - PicoRuby
6
+ - Microcontroller
7
+ - RP2040
8
+ presentation_date: '2023-09-21'
9
+ presentation_start_time:
10
+ presentation_end_time:
11
+ version: 2022.09.21.0
12
+ licenses: ["MIT License"]
13
+ slideshare_id:
14
+ speaker_deck_id:
15
+ ustream_id:
16
+ vimeo_id:
17
+ youtube_id:
18
+ author:
19
+ markup_language: :rd
20
+ name: HASUMI Hitoshi
21
+ email: hasumikin@gmail.com
22
+ rubygems_user: hasumikin
23
+ slideshare_user:
24
+ speaker_deck_user:
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,17 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="223" height="26" viewBox="0 0 223 26">
2
+ <g fill="none" fill-rule="evenodd">
3
+ <path fill="#ED1944" d="M6.1074401 11.8725404L8.33081634 11.8725404C9.11628416 11.8725404 9.67433614 11.7516681 10.0052483 11.5099234 10.3353324 11.2681787 10.5006505 10.8436043 10.5006505 10.234817 10.5006505 9.64428511 10.3353324 9.22385957 10.0052483 8.97298723 9.67433614 8.72266809 9.11628416 8.59709362 8.33081634 8.59709362L6.1074401 8.59709362 6.1074401 11.8725404zM7.8216146 15.9799872L6.1074401 15.9799872 6.1074401 21.8590298.0000551980198 21.8590298.0000551980198 4.14085957 9.58988317 4.14085957C11.9471146 4.14085957 13.7283547 4.63734894 14.9336035 5.63088085 16.1394042 6.62385957 16.7418906 8.10502979 16.7418906 10.0735617 16.7418906 12.6691362 15.6793287 14.4139021 13.554205 15.3086894L17.733247 21.8590298 10.9560342 21.8590298 7.8216146 15.9799872zM35.4391986 14.2346957C35.4391986 19.4963766 32.5904288 22.1276319 26.8939932 22.1276319 21.1972816 22.1276319 18.3487877 19.4963766 18.3487877 14.2346957L18.3487877 4.14088723 24.6173509 4.14088723 24.6173509 14.7181851C24.6173509 15.6132489 24.808888 16.2886957 25.1930662 16.7450787 25.5769684 17.2017383 26.1441281 17.4296532 26.8939932 17.4296532 27.6441343 17.4296532 28.2154338 17.2017383 28.6084437 16.7450787 29.0009016 16.2886957 29.1979585 15.6132489 29.1979585 14.7181851L29.1979585 4.14088723 35.4391986 4.14088723 35.4391986 14.2346957zM46.7430631 17.7785787C47.8500594 17.7785787 48.4039715 17.3404511 48.4039715 16.463366 48.4039715 15.6219617 47.8500594 15.2015362 46.7430631 15.2015362L43.5553775 15.2015362 43.5553775 17.7785787 46.7430631 17.7785787zM46.2876795 11.0136C47.3949517 11.0136 47.9485879 10.5837702 47.9485879 9.72466383 47.9485879 8.86555745 47.3949517 8.43628085 46.2876795 8.43628085L43.5553775 8.43628085 43.5553775 11.0136 46.2876795 11.0136zM37.5818478 4.14074894L47.7076485 4.14074894C49.9398564 4.15900426 51.6004889 4.55702553 52.6900978 5.33564255 53.7791547 6.11425957 54.3236832 7.29089787 54.3236832 8.86555745 54.3236832 9.95755745 53.9891832 10.8658979 53.3193552 11.5903021 52.6498032 12.3155362 51.6540309 12.7677702 50.3325903 12.9464511L50.3325903 12.9730043C51.8325965 13.133983 52.9487005 13.5817915 53.6809022 14.3153234 54.413104 15.0496851 54.7793428 16.006983 54.7793428 17.1877702 54.7793428 18.7450043 54.2522017 19.9127915 53.1987475 20.6911319 52.1450173 21.4700255 50.5470347 21.8591957 48.4039715 21.8591957L37.5818478 21.8591957 37.5818478 4.14074894z"/>
4
+ <polygon fill="#ED1944" points="67.637 15.711 67.637 21.859 61.396 21.859 61.396 15.711 55.208 4.141 61.422 4.141 63.297 8.195 64.556 11.416 65.815 8.195 67.691 4.141 73.825 4.141"/>
5
+ <path fill="#000006" d="M81.9684522 22.1276596C80.1110389 22.1276596 78.5086403 21.7700213 77.1601527 21.0536383 75.8116651 20.3380851 74.7761502 19.2953191 74.0527802 17.9261702 73.3299621 16.5570213 72.9681391 14.9154255 72.9681391 13 72.9681391 11.0851277 73.3299621 9.44297872 74.0527802 8.07382979 74.7761502 6.70468085 75.8116651 5.66219149 77.1601527 4.94608511 78.5086403 4.23053191 80.1110389 3.87234043 81.9684522 3.87234043 84.0400339 3.87234043 85.8077505 4.31544681 87.2727059 5.20110638 88.7365574 6.08731915 89.6476007 7.43406383 90.0047319 9.24134043L84.6474881 11.3354468C84.5042493 10.2442766 84.2456465 9.50991489 83.870576 9.13402128 83.4955054 8.75840426 82.9148223 8.57031915 82.1293545 8.57031915 81.2006478 8.57031915 80.5040488 8.92851064 80.0398334 9.64434043 79.5753421 10.3601702 79.3435104 11.479 79.3435104 13 79.3435104 14.5212766 79.5665104 15.6401064 80.0130624 16.3556596 80.4593384 17.0720426 81.1471057 17.4296809 82.0758124 17.4296809 82.9148223 17.4296809 83.5222765 17.2415957 83.897071 16.8659787 84.2724176 16.4900851 84.5136329 15.8724468 84.6204411 15.0133404L90.1388631 16.4361489C89.2280958 20.2310426 86.5046255 22.1276596 81.9684522 22.1276596M97.9737252 9.63073191C97.5539443 10.3382638 97.3441918 11.460966 97.3441918 12.9999447 97.3441918 14.5394766 97.5539443 15.6624553 97.9737252 16.369434 98.3932302 17.0764128 99.0586423 17.4296255 99.9691337 17.4296255 100.880177 17.4296255 101.540345 17.0764128 101.951847 16.369434 102.361968 15.6624553 102.567856 14.5394766 102.567856 12.9999447 102.567856 11.460966 102.361968 10.3382638 101.951847 9.63073191 101.540345 8.92402979 100.880177 8.57054043 99.9691337 8.57054043 99.0586423 8.57054043 98.3932302 8.92402979 97.9737252 9.63073191M106.572473 6.27507234C108.152792 7.87711489 108.943228 10.1186468 108.943228 12.9999447 108.943228 15.8817957 108.152792 18.1236043 106.572473 19.7250936 104.991877 21.3268596 102.790856 22.1276043 99.9691337 22.1276043 98.1117203 22.1276043 96.5093218 21.769966 95.1608342 21.053583 93.8123465 20.3380298 92.7768317 19.2952638 92.0534616 17.9261149 91.3306436 16.5572426 90.9688205 14.9153702 90.9688205 12.9999447 90.9688205 11.0850723 91.3306436 9.4429234 92.0534616 8.07377447 92.7768317 6.70462553 93.8123465 5.66213617 95.1608342 4.94602979 96.5093218 4.23075319 98.1117203 3.87228511 99.9691337 3.87228511 102.790856 3.87228511 104.991877 4.67358298 106.572473 6.27507234"/>
6
+ <polygon fill="#000006" points="128.229 21.859 121.479 21.859 117.247 13.806 116.282 11.631 116.229 11.631 116.336 15.282 116.336 21.859 110.925 21.859 110.925 4.141 117.675 4.141 121.908 12.221 122.872 14.369 122.926 14.369 122.819 10.718 122.819 4.141 128.229 4.141"/>
7
+ <polygon fill="#000006" points="137.015 8.732 137.015 11.202 143.819 11.202 143.819 15.792 137.015 15.792 137.015 21.859 130.774 21.859 130.774 4.141 145.426 4.141 145.426 8.732"/>
8
+ <polygon fill="#000006" points="147.452 6.155 147.452 4.136 161.892 4.136 161.892 6.155 155.745 6.155 155.745 21.859 153.6 21.859 153.6 6.155"/>
9
+ <polygon fill="#000006" points="165.499 21.859 165.499 4.137 167.644 4.137 167.644 11.87 177.232 11.87 177.232 4.137 179.376 4.137 179.376 21.859 177.232 21.859 177.232 13.889 167.644 13.889 167.644 21.859"/>
10
+ <path fill="#000006" d="M193.52572 1.75668723L191.944573 1.75668723C191.631876 1.75668723 191.382657 1.82030426 191.197192 1.94698511 191.011726 2.07394255 190.865176 2.24985745 190.758367 2.4741766 190.650731 2.69877234 190.582562 2.94743191 190.553031 3.22043191 190.524052 3.49398511 190.509148 3.77694255 190.509148 4.06985745L190.509148 9.22283617C190.509148 9.88666596 190.411448 10.4478787 190.216599 10.9064745 190.020922 11.3653468 189.786606 11.7409638 189.513376 12.0338787 189.23987 12.326517 188.961672 12.546134 188.678782 12.6924532 188.395616 12.8387723 188.166544 12.9317085 187.990463 12.9704319L187.990463 13.0290702C188.166544 13.0489851 188.395616 13.122283 188.678782 13.2486872 188.961672 13.3759213 189.23987 13.5811553 189.513376 13.8638362 189.786606 14.1467936 190.020922 14.5273894 190.216599 15.0056234 190.411448 15.4838574 190.509148 16.0843468 190.509148 16.8062617L190.509148 21.9301979C190.509148 22.2228362 190.524052 22.505517 190.553031 22.7790702 190.582562 23.0523468 190.650731 23.2963043 190.758367 23.5112191 190.865176 23.7258574 191.011726 23.9014957 191.197192 24.038134 191.382657 24.1744957 191.631876 24.2430915 191.944573 24.2430915L193.52572 24.2430915 193.52572 26.0000277 191.47539 26.0000277C191.104735 26.0000277 190.738496 25.9217511 190.377501 25.7657511 190.015954 25.6091979 189.689182 25.3749213 189.396356 25.0629213 189.103531 24.7503681 188.864247 24.3650702 188.678782 23.9064745 188.493317 23.4476021 188.40086 22.9259426 188.40086 22.3401128L188.40086 17.2161766C188.40086 16.6889851 188.327723 16.2204319 188.181172 15.8107936 188.034621 15.4008787 187.844188 15.0496021 187.609872 14.7566872 187.375833 14.4640489 187.107294 14.2444319 186.804533 14.0981128 186.501772 13.951517 186.194595 13.8784957 185.882174 13.8784957L185.882174 12.1218362C186.194595 12.1218362 186.501772 12.0435596 186.804533 11.8870064 187.107294 11.731283 187.375833 11.511666 187.609872 11.2284319 187.844188 10.9457511 188.034621 10.5989 188.181172 10.1889851 188.327723 9.77907021 188.40086 9.32102766 188.40086 8.81292128L188.40086 3.65994255C188.40086 3.07438936 188.498009 2.5521766 188.693686 2.09330426 188.888259 1.63498511 189.132786 1.24941064 189.425887.936857447 189.718437.624857447 190.045485.390857447 190.406756.234304255 190.768027.0783042553 191.12433.0000276595745 191.47539.0000276595745L193.52572.0000276595745 193.52572 1.75668723zM215.221412 0L217.271467 0C217.622526 0 217.978829.0782765957 218.340376.234276596 218.701371.390829787 219.02842.624829787 219.321245.936829787 219.614071 1.24938298 219.858046 1.63495745 220.053723 2.0932766 220.248296 2.55242553 220.346272 3.0743617 220.346272 3.65991489L220.346272 8.81289362C220.346272 9.321 220.419686 9.77904255 220.565961 10.1889574 220.712511 10.5988723 220.902668 10.9457234 221.136984 11.2284043 221.371024 11.5116383 221.639562 11.7312553 221.942599 11.8872553 222.244808 12.0435319 222.552261 12.1218085 222.864682 12.1218085L222.864682 13.8784681C222.552261 13.8784681 222.244808 13.9514894 221.942599 14.0980851 221.639562 14.2444043 221.371024 14.4640213 221.136984 14.7566596 220.902668 15.0495745 220.712511 15.4008511 220.565961 15.810766 220.419686 16.2206809 220.346272 16.6889574 220.346272 17.2161489L220.346272 22.3400851C220.346272 22.9259149 220.253264 23.4475745 220.06835 23.9064468 219.882333 24.3650426 219.643326 24.7503404 219.3505 25.0628936 219.057675 25.3748936 218.73035 25.6091702 218.369631 25.7657234 218.008084 25.9217234 217.641845 26 217.271467 26L215.221412 26 215.221412 24.2430638 216.80256 24.2430638C217.114704 24.2430638 217.363647 24.1744681 217.549665 24.0381064 217.734854 23.9014681 217.876437 23.7258298 217.974137 23.5111915 218.071562 23.2962766 218.139732 23.0523191 218.179474 22.7790426 218.217837 22.5054894 218.237984 22.2228085 218.237984 21.9301702L218.237984 16.806234C218.237984 16.0843191 218.335133 15.4838298 218.530534 15.0055957 218.725383 14.5273617 218.959698 14.146766 219.23348 13.8638085 219.506435 13.5811277 219.784633 13.3758936 220.06835 13.2486596 220.350964 13.1222553 220.580588 13.0489574 220.756394 13.0290426L220.756394 12.9706809C220.580588 12.9316809 220.350964 12.8387447 220.06835 12.6924255 219.784633 12.5461064 219.506435 12.3264894 219.23348 12.0338511 218.959698 11.7409362 218.725383 11.3653191 218.530534 10.9064468 218.335133 10.4478511 218.237984 9.8866383 218.237984 9.22280851L218.237984 4.06982979C218.237984 3.77691489 218.217837 3.49395745 218.179474 3.22068085 218.139732 2.94740426 218.071562 2.69874468 217.974137 2.47414894 217.876437 2.24982979 217.734854 2.07419149 217.549665 1.94695745 217.363647 1.82055319 217.114704 1.75665957 216.80256 1.75665957L215.221412 1.75665957 215.221412 0zM210.159533 16.3250957C208.730732 17.4674362 207.01987 18.0953085 205.352337 18.0953085 205.263193 18.0953085 205.1746 18.0889468 205.085179 18.0853511 205.824557 18.9804149 206.821433 19.7200319 207.988595 20.2046277 209.923837 21.0081383 212.026606 20.9896064 213.683927 20.1683936 213.14133 18.560266 211.858528 17.1659468 210.159533 16.3250957"/>
11
+ <path fill="#000006" d="M210.823896 15.7335404C211.66815 16.1926894 212.410287 16.7810085 213.018846 17.4592213 213.975979 16.9129447 214.763931 16.1788596 215.309839 15.329434 214.57129 14.5292426 213.577726 13.912434 212.437059 13.548434 212.032733 14.3367319 211.490412 15.0791149 210.823896 15.7335404M203.394519 18.0954191C201.726987 18.0954191 200.016124 17.4672702 198.587323 16.3252064 196.888604 17.1660574 195.605526 18.5606532 195.063206 20.1682277 196.720526 20.989717 198.823295 21.0079723 200.758538 20.2047383 201.9257 19.7201426 202.922576 18.9802489 203.661677 18.0854617 203.572809 18.0890574 203.48394 18.0954191 203.394519 18.0954191M204.376657 18.5175872C203.91879 19.090417 203.369569 19.6076511 202.745004 20.0493745 203.179136 20.8210766 203.738016 21.4835234 204.389077 21.989417 205.035998 21.4868426 205.591014 20.8302043 206.024042 20.065417 205.391473 19.6212043 204.839769 19.0962255 204.376657 18.5175872M195.727983 17.4593043C196.336817 16.7810915 197.079231 16.1930489 197.923208 15.7336234 197.256416 15.0791979 196.714096 14.3368149 196.30977 13.5482404 195.169379 13.912517 194.175815 14.5293255 193.436989 15.329517 193.983174 16.1789426 194.771125 16.9127511 195.727983 17.4593043M211.126575 10.0290298L204.826825 17.2412638C206.665471 17.4141362 208.636592 16.6750723 210.15647 15.229583 211.676071 13.783817 212.513977 11.8512426 212.439184 9.99971064 212.006431 9.95960426 211.566227 9.97149787 211.126575 10.0290298"/>
12
+ <polygon fill="#ED1944" points="204.389 14.077 206.246 8.512 202.532 8.512"/>
13
+ <polygon fill="#ED1944" points="201.659 8.512 198.631 8.512 198.631 7.683 201.382 7.683 200.431 4.834 201.216 4.571 202.114 7.262 204.389 4.327 206.664 7.263 207.562 4.573 208.347 4.836 207.397 7.683 210.147 7.683 210.147 8.512 207.12 8.512 204.503 16.352 211.633 8.19 208.153 4.011 200.625 4.011 197.146 8.19 204.275 16.352"/>
14
+ <polygon fill="#ED1944" points="202.837 7.683 205.941 7.683 204.389 5.68"/>
15
+ <path fill="#000006" d="M197.655332,10.0330681 C197.204089,9.97138723 196.752293,9.95838723 196.307673,9.9996 C196.232879,11.8511319 197.070785,13.783983 198.590387,15.2294723 C200.110264,16.6746851 202.080558,17.4143021 203.920308,17.2414298 C203.92086,17.2298128 203.920308,17.2179191 203.920584,17.2063021 L197.655332,10.0330681 Z"/>
16
+ </g>
17
+ </svg>
Binary file
Binary file
Binary file
Binary file
data/images/hasumi.jpg ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/theme.rb ADDED
@@ -0,0 +1,197 @@
1
+ # puts font_families.sort
2
+ @xxx_large_font_size = screen_size(9.5 * Pango::SCALE)
3
+ @xx_large_font_size = screen_size(8 * Pango::SCALE)
4
+ @x_large_font_size = screen_size(7 * Pango::SCALE)
5
+ @large_font_size = screen_size(5.5 * Pango::SCALE)
6
+ @normal_font_size = screen_size(4.5 * Pango::SCALE)
7
+ @small_font_size = screen_size(4 * Pango::SCALE)
8
+ @x_small_font_size = screen_size(3 * Pango::SCALE)
9
+ @xx_small_font_size = screen_size(2.5 * Pango::SCALE)
10
+
11
+ @font_family = find_font_family('Work Sans')
12
+ @monospace_font_family = 'Courier Prime'
13
+ @title_font_family = find_font_family('Work Sans')
14
+
15
+ # colors
16
+ foreground = "#000006"
17
+ red = "#f81c49"
18
+ green = "#2bba7e"
19
+ blue = "#0499da"
20
+ black = "#000000"
21
+ dark_gray = "#333333"
22
+ light_gray = "#a9a7ad"
23
+ preformatted_foreground = "#00ffc2"
24
+
25
+ @default_headline_line_color = red
26
+ @default_headline_line_width = 2
27
+ @default_headline_line_expand = true
28
+
29
+ @default_emphasis_color = red
30
+ @default_emphasis_level2_color = "#ffffff"
31
+
32
+ set_graffiti_color red
33
+ set_graffiti_line_width 7
34
+
35
+ #@table_frame_color = "#ffffff"
36
+ #@table_fill_color = "#0f0428"
37
+ #@table_body_frame_color = "#ffffff"
38
+ #@table_body_fill_color = "#3f3468"
39
+ #@table_head_frame_color = "#ffffff"
40
+ #@table_head_fill_color = "#rf0428"
41
+
42
+ @preformatted_fill_color = black
43
+ @preformatted_frame_color = light_gray
44
+ @preformatted_frame_width = 5
45
+ # @preformatted_centering = true
46
+
47
+ @space = screen_y(1)
48
+
49
+ @image_slide_number_start_flag_color = green
50
+ @image_slide_number_goal_flag_color = red
51
+
52
+ #@slide_headline_hide = true
53
+
54
+ @slide_background_image = 'images/assets/background-slide.png'
55
+ include_theme("slide-background-image")
56
+
57
+ @title_slide_background_image = 'images/assets/background-title.png'
58
+ include_theme("title-slide-background-image")
59
+
60
+ include_theme('default')
61
+
62
+ match(Slide, HeadLine) do |heads|
63
+ heads.margin_top = 20
64
+ heads.prop_set("weight", "normal")
65
+ heads.prop_set "size", @large_font_size
66
+ set_font_family(heads)
67
+ end
68
+ match(Slide) do |slides|
69
+ slides.margin_left = 100
70
+ slides.margin_right = 100
71
+ slides.prop_set("foreground", foreground)
72
+ end
73
+
74
+ match TitleSlide do |slides|
75
+ # slides.margin_left = 770
76
+ slides.prop_set("foreground", foreground)
77
+ slides.prop_set "style", "normal"
78
+ end
79
+ match TitleSlide, Title do |title|
80
+ title.margin_top = 0
81
+ title.prop_set "size", @xxx_large_font_size
82
+ title.prop_set "font-family", @title_font_family
83
+ title.prop_set "weight", "bold"
84
+ title.prop_set "foreground", red
85
+ end
86
+ match TitleSlide, Subtitle do |subtitle|
87
+ subtitle.prop_set "size", @xxx_large_font_size
88
+ subtitle.prop_set "font-family", @title_font_family
89
+ subtitle.prop_set "weight", "bold"
90
+ end
91
+ match TitleSlide, Author do |authors|
92
+ authors.margin_top = 50
93
+ authors.prop_set "size", @large_font_size
94
+ end
95
+ match TitleSlide, ContentSource do |cs|
96
+ cs.margin_top = 10
97
+ cs.prop_set "size", @small_font_size
98
+ cs.prop_set "weight", "bold"
99
+ cs.prop_set "foreground", red
100
+ end
101
+ match TitleSlide, Place do |cs|
102
+ cs.margin_top = 150
103
+ cs.prop_set "size", @x_small_font_size
104
+ end
105
+ match TitleSlide, Date do |date|
106
+ date.prop_set "size", @x_small_font_size
107
+ end
108
+ match TitleSlide, Institution do |i|
109
+ i.prop_set "size", @x_small_font_size
110
+ end
111
+
112
+ #@slide_logo_image = 'images/mark_g.png'
113
+ #include_theme('slide-logo')
114
+
115
+ @item_image_1 = 'images/assets/bullet-point-36.png'
116
+ @item_image_2 = 'images/assets/bullet-point-36.png'
117
+ @item_image_3 = 'images/assets/bullet-point-24.png'
118
+
119
+ include_theme("default-item-mark")
120
+
121
+ add_image_path("rabbit-images")
122
+
123
+ slide_body = [Slide, Body]
124
+ item_list_item = [ItemList, ItemListItem]
125
+
126
+ indent = 40
127
+
128
+ match(*(slide_body + (item_list_item * 1))) do |items|
129
+ name = "item1"
130
+ items.delete_pre_draw_proc_by_name(name)
131
+ items.delete_post_draw_proc_by_name(name)
132
+ draw_image_mark(items, @item_image_1, name, indent: indent)
133
+ end
134
+
135
+ match(*(slide_body + (item_list_item * 2))) do |items|
136
+ name = "item2"
137
+ items.delete_pre_draw_proc_by_name(name)
138
+ items.delete_post_draw_proc_by_name(name)
139
+ draw_image_mark(items, @item_image_2, name, indent: indent)
140
+ end
141
+
142
+ match(*(slide_body + (item_list_item * 3))) do |items|
143
+ name = "item3"
144
+ items.delete_pre_draw_proc_by_name(name)
145
+ items.delete_post_draw_proc_by_name(name)
146
+ draw_image_mark(items, @item_image_3, name, indent: indent)
147
+ end
148
+
149
+ enum_list_item = [EnumList, EnumListItem]
150
+
151
+ match(*(slide_body + enum_list_item + item_list_item)) do |items|
152
+ name = "enum-item1"
153
+ items.delete_pre_draw_proc_by_name(name)
154
+ items.delete_post_draw_proc_by_name(name)
155
+ draw_image_mark(items, @item_image_1, name, indent: indent)
156
+ end
157
+
158
+ match(*(slide_body + enum_list_item + (item_list_item * 2))) do |items|
159
+ name = "enum-item2"
160
+ items.delete_pre_draw_proc_by_name(name)
161
+ items.delete_post_draw_proc_by_name(name)
162
+ draw_image_mark(items, @item_image_2, name, indent: indent)
163
+ end
164
+
165
+ # table
166
+ all_table = ["**", Table]
167
+ match(*(all_table + [TableBody, TableRow, TableCell])) do |cells|
168
+ set_font_family(cells, @monospace_font_family)
169
+ end
170
+ match(*(all_table + [TableHead, TableRow, TableHeader])) do |headers|
171
+ set_font_family(headers, @monospace_font_family)
172
+ end
173
+
174
+ match("**", Emphasis, Emphasis) do |texts|
175
+ texts.prop_set("foreground", @default_emphasis_level2_color)
176
+ texts.prop_set("weight", "normal")
177
+ end
178
+
179
+ # Chapter
180
+ match Slide do |slides|
181
+ slides.each do |slide|
182
+ if slide.match?(/sub_chapter/)
183
+ slide.horizontal_centering = true
184
+ elsif slide.match?(/chapter/)
185
+ set_font_family slide, @title_font_family
186
+ slide.horizontal_centering = true
187
+ elsif slide.match?(/cite/)
188
+ slide.prop_set "foreground", foreground
189
+ slide.horizontal_centering = true
190
+ end
191
+ end
192
+ end
193
+
194
+ match("**", PreformattedBlock) do |block|
195
+ block.prop_set("foreground", preformatted_foreground)
196
+ # block.prop_set("fill", dark_gray)
197
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rabbit-slide-hasumikin-RubyConfTH2023
3
+ version: !ruby/object:Gem::Version
4
+ version: 2022.09.21.0
5
+ platform: ruby
6
+ authors:
7
+ - HASUMI Hitoshi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-10-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rabbit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.2
27
+ description: Presentation slide for RubyConfTH 2023
28
+ email:
29
+ - hasumikin@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rabbit"
35
+ - ABeginnersCompleteGuideToMicrocontrollerProgrammingWithRuby.rab
36
+ - README.rd
37
+ - Rakefile
38
+ - config.yaml
39
+ - images/QR_github-com-peripheral-interface-guide.png
40
+ - images/QR_github-com-picoruby.png
41
+ - images/R2D2_mosaic.png
42
+ - images/assets/background-slide.png
43
+ - images/assets/background-title.png
44
+ - images/assets/bullet-point-24.png
45
+ - images/assets/bullet-point-36.png
46
+ - images/assets/bullet-point-48.png
47
+ - images/assets/bullet-point.png
48
+ - images/assets/logo-text-icon.svg
49
+ - images/boot_button_1.png
50
+ - images/crkbd_2.jpg
51
+ - images/download-r2p2.png
52
+ - images/drag-and-drop.png
53
+ - images/hasumi.jpg
54
+ - images/install-uf2.png
55
+ - images/okinawa.jpg
56
+ - images/rp2-resistor-led_bb.png
57
+ - images/rp2-resistor-led_schem.png
58
+ - images/rp2-resistor-thermistor_bb.png
59
+ - images/rp2-resistor-thermistor_schem.png
60
+ - images/rp2040-peripheral-demo_bb-trim.png
61
+ - images/rpi_pico.jpg
62
+ - images/teraterm-0.png
63
+ - images/teraterm.png
64
+ - pdf/RubyConfTH2023-ABeginnersCompleteGuideToMicrocontrollerProgrammingWithRuby.rab.pdf
65
+ - theme.rb
66
+ homepage: https://slide.rabbit-shocker.org/authors/hasumikin/RubyConfTH2023/
67
+ licenses:
68
+ - MIT License
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubygems_version: 3.4.13
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: A Beginner's Complete Guide to Microcontroller Programming with Ruby
89
+ test_files: []