-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsamples.ts
More file actions
1513 lines (1270 loc) · 28.6 KB
/
samples.ts
File metadata and controls
1513 lines (1270 loc) · 28.6 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
namespace microcode {
export class Sample {
constructor(
public readonly label: string,
public readonly ariaId: string,
public readonly icon: string,
public readonly b64: string
) {}
get source() {
return Buffer.fromBase64(this.b64)
}
}
type rawSampleList = {
label: string
ariaId?: string
b64?: string
// leave empty to hide sample
icon?: string
}[]
export class TextSample {
constructor(
public readonly label: string,
public readonly ariaId: string,
public readonly icon: string,
public readonly src: string
) {}
get source() {
return this.src
}
}
type textSampleList = {
label: string
ariaId?: string
src: string
// leave empty to hide sample
icon?: string
}[]
//% shim=TD_NOOP
export function robotSamples(r: { s: rawSampleList }) {
r.s = r.s.concat([
{
label: "robot shake",
b64: "JfiSPgounQ1cNL4NWzTCDV00wMINXjTBwgEBAQEBAA==",
},
{
label: "robot wake",
b64: "JfiSPgounRI0wMDAwgEBAQEBAA==",
},
{
label: "robot avoid wall",
b64: "JfiSPgounQo0vhlPNMC+AQEBAQEA",
},
{
label: "robot line follow",
b64: "JfiSPgoumxpoNL4aZjTAGmc0wRpqNMQaazTFGmk0wgEBAQEBAA==",
},
{
label: "robot showcase",
b64: "JfiSPgoumwtJNL7IC0o0wsYZTzTEvgEBAQEBAA==",
},
{
label: "robot drift tester",
b64: "JfiSPgoumwtJNL7IC0o0w8cSNMLGAQEBAQEA",
},
])
}
//% shim=TD_NOOP
function rawWebAppSamples(r: { s: rawSampleList }) {
r.s = r.s.concat([
{
label: "first program",
b64: "JfiSPgtJLKBAgegAC0kpowEBAQEBAA==",
},
{
label: "flashing heart",
ariaId: "N2",
b64: "JfiSPg4soKpGRQCgQDkCAA4powEBAQEBAA==",
icon: "flashing_heart",
},
{
label: "counter",
ariaId: "N14",
b64: "JfiSPgtJMK2bEzOtEymlAQEBAQEA",
},
{
label: "times table",
b64: "JfiSPg1aMbGenxQwrgtJMK2uEzOtEymlAQEBAQEA",
},
{
label: "double counter",
b64: "JfiSPgoppAozrQtJMK2bEzOtC0oolwEKKaUKM64LSjGumxQzrgtJKJYBAQEBAA==",
},
{
label: "pet hamster",
ariaId: "N4",
b64: "JfiSPgosoGADBwALTSygQIHoAKBgAwcAsp0LTSmjDVosoEABFwGgYAMHALKdDVoppwEBAQEBAA==",
icon: "pet_hamster",
},
{
label: "head or tail",
ariaId: "N9",
b64: "JfiSPg0wsZwNK7N4MTWzeAEAE04soL9+5wATTyygP8b4AQEBAQEBAA==",
icon: "heads_tails",
},
{
label: "rock, paper, scissors",
ariaId: "N8",
b64: "JfiSPg1aMLGdDVopqBNOLKAAAAAAoMA5BwATTyygAAAAAKA/xvgBE1AsoAAAAACgc5E1AQEBAQEBAA==",
icon: "rock_paper_scissors",
},
{
label: "hot potato",
ariaId: "N7",
b64: "JfiSPg5WVVUolw4soAAQAACgAAAAAAEKLKC/fucACimnAQEBAQA=",
icon: "hot_potato",
},
{
label: "clap lights",
ariaId: "N10",
b64: "JfiSPgosoP///wEKKaUSVyiXAQosoAAAAAAKKawSVyiWAQEBAQA=",
icon: "clap_lights",
},
{
label: "24 7 clap",
ariaId: "N13",
b64: "JfiSPgoppQowmwosoEqprQCgjDHPALISVzCtmw5WVFQolxNSUlJSUiiYAQopowozrQ5WViiWAQoppwosoL864ACgvzoHALIOVlYolgEBAQA=",
},
{
label: "reaction time",
ariaId: "N6",
b64: "JfiSPgosoAAIAACgABAAAKAAIAAAsg5WVVVVVVUolwtJKJkLSiiYAQosoP///wEKKaULSSiYC0oomQEKLKBEPEEAoIh4ggCyDlYolgEKLKAEfUQAoII8IgCyDlYolgEBAA==",
icon: "reaction_time",
},
{
label: "chuck a duck",
ariaId: "N5",
b64: "JfiSPg1aLKAAEAAADVotmxFOLKDmeAcAEU4ppQEBAQEBAA==",
icon: "teleport_duck",
},
{
label: "zombie detector",
b64: "JfiSPg4soAAQAACgQAEFAKARABABoAAAAAARTiiXC00omAEOLKCEEEAAoEopoAAOVCmmDlYolgEOLKC/OuAAoL86BwAOLZsBAQEA",
},
{
label: "firefly",
ariaId: "N11",
b64: "JfiSPgosoAAQAAARMK2bDlMwrZsTUFIolw5UVFQolwEKLQowmwosoP/v/wEKKaUOUyiWAQEBAQA=",
icon: "firefly",
},
{
label: "railroad crossing",
ariaId: "N12",
b64: "JfiSPgo3zAtJNZsLSS+2u7ILSjWfC0ovuLuyC00vvLIBAQEBAQA=",
icon: "railroad_crossing",
},
{
label: "moves",
b64: "JfiSPg1cLKAnpXQADVssoCml9AANXSygIYTwAA1eLKAnnZQADVosoC889AABAQEBAQA=",
},
{
label: "coins",
b64: "JfiSPgtJMJsLSjCtmxNQLKAecugBE1EsoC88dAATUiygvdbaAQEBAQEBAA==",
},
{
label: "inchworm",
b64: "JfiSPgo1mw5TUyiXAQo1nw5TUyiWAQEBAQA=",
},
{
label: "head guess",
b64: "JfiSPgoppQowsZ0KMZsNXDCxnQ1bMLGdDVsxrpsOVlZWViiXE04soOZ5BwATTyygL4TwAKAvvZQAoJ8QQgCyE1AsoCeldACgL6X0AKAvtPQAsgEKM64KKaMOVlYolgEBAQEA",
},
{
label: "battery charger prank",
b64: "JfiSPgosoE4p5QCgTimlALINWiiXAQosoE4p5QCgTinnAKBOOecAoM455wCyDlYolgEBAQEA",
},
{
label: "green light red light",
b64: "JfiSPgtNKJcRTyiYCiyg5VMnAKDkEwcAoPQXhwCyCimlAQowmw4trQtJMJsLSjCcE04soOVTJwCg5BMHAKD0F4cAshNPLKBRERUBAQ1aKacNWiygvzrgAKC/OgcAshFOKJYBAQEA",
},
{
label: "crooked head or tail",
b64: "JfiSPg0wsZ0NKagTTiygv37nABNPLKA/xvgBE1AsoD/G+AEBAQEBAQA=",
},
{
label: "step counter",
b64: "JfiSPg1aMK2bEzOtEymlAQEBAQEA",
},
{
label: "clap counter",
b64: "JfiSPhJXMK2bEzOtAQEBAQEA",
},
{
label: "random counter",
b64: "JfiSPgtJMJuxnwtJMRMzrQtKMa6bFF8soECB6AABAQEBAQA=",
},
{
label: "slider levels",
b64: "JfiSPhdOM5sXTzOcF1AznRdRM54XUjOfAQEBAQEA",
},
{
label: "light levels",
b64: "JfiSPg9OM5sPTzOcD1AznQ9RM54PUjOfAQEBAQEA",
},
{
label: "magnet levels",
b64: "JfiSPhZOM5sWTzOcFlAznRZRM54WUjOfAQEBAQEA",
},
{
label: "count turns",
b64: "JfiSPhhiMK2bGGMxrpsTM60UM64BAQEBAQA=",
},
{
label: "key demo",
b64: "JfiSPgosoAAQAAALSyygQIHoAAtMLKBAARcBAQEBAQEA",
},
{
label: "more water please!",
b64: "JfiSPhxONswcUDbNAQEBAQEA",
},
{
label: "don't stand too close to me!",
b64: "JfiSPh1OL7YdUC+6HVIvtwEBAQEBAA==",
},
{
label: "start/stop servo",
b64: "JfiSPgtJN8wMSjfNAQEBAQEA",
},
{
label: "move off the line",
b64: "JfiSPh5uN8webzfNAQEBAQEA",
},
])
}
export function rawSamples() {
const s: rawSampleList = [
{
label: "new program",
ariaId: "N1",
b64: "JfiSPgEBAQEBAA==",
icon: "new_program",
},
{
label: "smiley buttons",
ariaId: "N3",
b64: "JfiSPgtJLKB7g+gAoBtEBwALSSmkC0osoHsDFwGgewPwAQtKKacBAQEBAQA=",
icon: "smiley_buttons",
},
]
return s
}
export function samples(withIcon: boolean): Sample[] {
const s = rawSamples()
const r = { s: s }
rawWebAppSamples(r)
// robotSamples(r)
return r.s
.filter(({ icon }) => !withIcon || !!icon)
.map(
({ label, ariaId, icon, b64 }) =>
new Sample(label, ariaId, icon, b64)
)
}
export function textSamples(withIcon: boolean): TextSample[] {
const s = newSamples()
return s
.filter(({ icon }) => !withIcon || !!icon)
.map(
({ label, ariaId, icon, src }) =>
new TextSample(label, ariaId, icon, src)
)
}
function newSamples(): textSampleList {
return [
{
label: "new program",
ariaId: "N1",
src: ``,
icon: "new_program",
},
{
label: "smiley buttons",
ariaId: "N3",
src: `when press button_A do show_image image \`
1 1 . 1 1
1 1 . 1 1
. . . . .
1 . . . 1
. 1 1 1 .
\`
image \`
1 1 . 1 1
. . . . .
1 . . . 1
. 1 1 1 .
. . . . .
\`
when press button_A do play_sound happy
when press button_B do show_image image \`
1 1 . 1 1
1 1 . 1 1
. . . . .
. 1 1 1 .
1 . . . 1
\`
image \`
1 1 . 1 1
1 1 . 1 1
. . . . .
. . . . .
1 1 1 1 1
\`
when press button_B do play_sound sad
`,
icon: "smiley_buttons",
},
{
label: "first program",
ariaId: undefined,
src: `when press button_A do show_image image \`
. . . . .
. 1 . 1 .
. . . . .
1 . . . 1
. 1 1 1 .
\`
when press button_A do play_sound giggle
`,
icon: undefined,
},
{
label: "flashing heart",
ariaId: "N2",
src: `when timer do show_image image \`
. 1 . 1 .
1 . 1 . 1
1 . . . 1
. 1 . 1 .
. . 1 . .
\`
image \`
. . . . .
. 1 . 1 .
. 1 1 1 .
. . 1 . .
. . . . .
\`
when timer do play_sound giggle
`,
icon: "flashing_heart",
},
{
label: "counter",
ariaId: "N14",
src: `when press button_A do set_variable_X variable_X add 1
when variable_X_set do show_number variable_X
when variable_X_set do play_sound hello
`,
icon: undefined,
},
{
label: "times table",
ariaId: undefined,
src: `when move shake do set_variable_Y random_number 4 add 5
when variable_Y_set do set_variable_X variable_Y
when press button_A do set_variable_X variable_X add variable_Y
when variable_X_set do show_number variable_X
when variable_X_set do play_sound hello
`,
icon: undefined,
},
{
label: "double counter",
ariaId: undefined,
src: `when start_page do play_sound happy
when start_page do show_number variable_X
when press button_A do set_variable_X variable_X add 1
when variable_X_set do show_number variable_X
when press button_B do switch_page page_2
page_2:
when start_page do play_sound hello
when start_page do show_number variable_Y
when press button_B do set_variable_Y variable_Y add 1
when variable_Y_set do show_number variable_Y
when press button_A do switch_page page_1
`,
icon: undefined,
},
{
label: "pet hamster",
ariaId: "N4",
src: `when start_page do show_image image \`
. . . . .
1 1 . 1 1
. . . . .
. 1 1 1 .
. . . . .
\`
when press logo do show_image image \`
. . . . .
. 1 . 1 .
. . . . .
1 . . . 1
. 1 1 1 .
\`
image \`
. . . . .
1 1 . 1 1
. . . . .
. 1 1 1 .
. . . . .
\`
repeat 3
when press logo do play_sound giggle
when move shake do show_image image \`
. . . . .
. 1 . 1 .
. . . . .
. 1 1 1 .
1 . . . 1
\`
image \`
. . . . .
1 1 . 1 1
. . . . .
. 1 1 1 .
. . . . .
\`
repeat 3
when move shake do play_sound sad
`,
icon: "pet_hamster",
},
{
label: "head or tail",
ariaId: "N9",
src: `when move do set_variable_X random_number 2
when move do music melody \`C E G E \`
melody \`C - - - \`
when variable_X_set equals 1 do show_image image \`
1 1 1 1 1
1 . 1 . 1
1 1 1 1 1
. 1 1 1 .
. 1 1 1 .
\`
when variable_X_set equals 2 do show_image image \`
1 1 1 1 1
1 . . . 1
1 . . . 1
1 . . . 1
1 1 1 1 1
\`
`,
icon: "heads_tails",
},
{
label: "rock, paper, scissors",
ariaId: "N8",
src: `when move shake do set_variable_X random_number 3
when move shake do play_sound slide
when variable_X_set equals 1 do show_image image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
image \`
. . . . .
. 1 1 1 .
. 1 1 1 .
. 1 1 1 .
. . . . .
\`
when variable_X_set equals 2 do show_image image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
image \`
1 1 1 1 1
1 . . . 1
1 . . . 1
1 . . . 1
1 1 1 1 1
\`
when variable_X_set equals 3 do show_image image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
image \`
1 1 . . 1
1 1 . 1 .
. . 1 . .
1 1 . 1 .
1 1 . . 1
\`
`,
icon: "rock_paper_scissors",
},
{
label: "hot potato",
ariaId: "N7",
src: `when timer 5_seconds 1_random_second 1_random_second do switch_page page_2
when timer do show_image image \`
. . . . .
. . . . .
. . 1 . .
. . . . .
. . . . .
\`
image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
page_2:
when start_page do show_image image \`
1 1 1 1 1
1 . 1 . 1
1 1 1 1 1
. 1 1 1 .
. 1 1 1 .
\`
when start_page do play_sound sad
`,
icon: "hot_potato",
},
{
label: "clap lights",
ariaId: "N10",
src: `when start_page do show_image image \`
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
\`
when start_page do play_sound hello
when sound loud do switch_page page_2
page_2:
when start_page do show_image image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
when start_page do play_sound yawn
when sound loud do switch_page page_1
`,
icon: "clap_lights",
},
{
label: "24 7 clap",
ariaId: "N13",
src: `when start_page do play_sound hello
when start_page do set_variable_X 1
when start_page do show_image image \`
. 1 . 1 .
. 1 . 1 .
. 1 . 1 .
1 1 . 1 1
. 1 . 1 .
\`
image \`
. . 1 1 .
. . 1 1 .
. . 1 1 .
. 1 1 1 1
. . 1 1 .
\`
repeat
when sound loud do set_variable_X variable_X add 1
when timer 5_seconds 1_second 1_second do switch_page page_2
when variable_X_set 5 add 5 add 5 add 5 add 5 do switch_page page_3
page_2:
when start_page do play_sound giggle
when start_page do show_number variable_X
when timer 5_seconds 5_seconds do switch_page page_1
page_3:
when start_page do play_sound sad
when start_page do show_image image \`
1 1 1 1 1
1 . 1 . 1
. 1 1 1 .
. . . . .
. 1 1 1 .
\`
image \`
1 1 1 1 1
1 . 1 . 1
. 1 1 1 .
. 1 1 1 .
. . . . .
\`
repeat
when timer 5_seconds 5_seconds do switch_page page_1
`,
icon: undefined,
},
{
label: "reaction time",
ariaId: "N6",
src: `when start_page do show_image image \`
. . . . .
. . . . .
. 1 . . .
. . . . .
. . . . .
\`
image \`
. . . . .
. . . . .
. . 1 . .
. . . . .
. . . . .
\`
image \`
. . . . .
. . . . .
. . . 1 .
. . . . .
. . . . .
\`
repeat
when timer 5_seconds 1_random_second 1_random_second 1_random_second 1_random_second 1_random_second do switch_page page_2
when press button_A do switch_page page_4
when press button_B do switch_page page_3
page_2:
when start_page do show_image image \`
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
\`
when start_page do play_sound hello
when press button_A do switch_page page_3
when press button_B do switch_page page_4
page_3:
when start_page do show_image image \`
. . 1 . .
. 1 . . .
1 1 1 1 .
. 1 . . .
. . 1 . .
\`
image \`
. . . 1 .
. . 1 . .
. 1 1 1 1
. . 1 . .
. . . 1 .
\`
repeat
when timer 5_seconds do switch_page page_1
page_4:
when start_page do show_image image \`
. . 1 . .
. . . 1 .
1 1 1 1 1
. . . 1 .
. . 1 . .
\`
image \`
. 1 . . .
. . 1 . .
1 1 1 1 .
. . 1 . .
. 1 . . .
\`
repeat
when timer 5_seconds do switch_page page_1
`,
icon: "reaction_time",
},
{
label: "chuck a duck",
ariaId: "N5",
src: `when move shake do show_image image \`
. . . . .
. . . . .
. . 1 . .
. . . . .
. . . . .
\`
when move shake do radio_send 1
when radio_receive equals 1 do show_image image \`
. 1 1 . .
1 1 1 . .
. 1 1 1 1
. 1 1 1 .
. . . . .
\`
when radio_receive equals 1 do play_sound hello
`,
icon: "teleport_duck",
},
{
label: "zombie detector",
ariaId: undefined,
src: `when timer do show_image image \`
. . . . .
. . . . .
. . 1 . .
. . . . .
. . . . .
\`
image \`
. . . . .
. 1 . 1 .
. . . . .
. 1 . 1 .
. . . . .
\`
image \`
1 . . . 1
. . . . .
. . . . .
. . . . .
1 . . . 1
\`
image \`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
\`
when radio_receive equals 1 do switch_page page_2
when press logo do switch_page page_3
page_2:
when timer do show_image image \`
. . 1 . .
. . 1 . .
. . 1 . .
. . . . .
. . 1 . .
\`
image \`
. 1 . 1 .
. 1 . 1 .
. 1 . 1 .
. . . . .
. 1 . 1 .
\`
when timer 1_second do play_sound mysterious
when timer 5_seconds do switch_page page_1
page_3:
when timer do show_image image \`
1 1 1 1 1
1 . 1 . 1
. 1 1 1 .
. . . . .
. 1 1 1 .
\`
image \`
1 1 1 1 1
1 . 1 . 1
. 1 1 1 .
. 1 1 1 .
. . . . .
\`
when timer do radio_send 1
`,
icon: undefined,
},
{
label: "firefly",
ariaId: "N11",
src: `when start_page do show_image image \`
. . . . .
. . . . .
. . 1 . .
. . . . .
. . . . .
\`
when radio_receive do set_variable_X variable_X add 1
when timer 1/4_second do set_variable_X variable_X add 1
when variable_X_set 3 add 5 do switch_page page_2
when timer 1_second 1_second 1_second do switch_page page_2
page_2:
when start_page do radio_send
when start_page do set_variable_X 1
when start_page do show_image image \`
1 1 1 1 1
1 1 1 1 1
1 1 . 1 1
1 1 1 1 1
1 1 1 1 1
\`
when start_page do play_sound hello
when timer 1/4_second do switch_page page_1
`,
icon: "firefly",
},
{
label: "railroad crossing",
ariaId: "N12",
src: `when start_page do servo_power on
when press button_A do servo_set_angle 1
when press button_A do LED red black repeat
when press button_B do servo_set_angle 5
when press button_B do LED blue black repeat
when press logo do LED rainbow repeat
`,
icon: "railroad_crossing",
},
{
label: "moves",
ariaId: undefined,
src: `when move tilt_down do show_image image \`
1 1 1 . .
1 . . 1 .
1 . . 1 .
1 . . 1 .
1 1 1 . .
\`
when move tilt_up do show_image image \`
1 . . 1 .
1 . . 1 .
1 . . 1 .
1 . . 1 .
1 1 1 1 .
\`
when move tilt_left do show_image image \`
1 . . . .
1 . . . .
1 . . . .
1 . . . .
1 1 1 1 .
\`
when move tilt_right do show_image image \`
1 1 1 . .
1 . . 1 .
1 1 1 . .
1 . . 1 .
1 . . 1 .
\`
when move shake do show_image image \`
1 1 1 1 .
1 . . . .
1 1 1 1 .
. . . 1 .
1 1 1 1 .
\`