This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.json
870 lines (848 loc) · 30.3 KB
/
tasks.json
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
[
{},
{
"name": "Hallo Welt",
"desc": "Der Anfang",
"instructions": [
{
"text": "Nehme unter der Kategorie \"Debug\" den Block \"Gebe ... in der Konsole aus\"",
"block": "debug_print",
"previousBlock": "event_whenflagclicked",
"blockTag": "helloworld"
},
{
"type": "changeblock",
"text": "Ändere den Text zu \"Hallo Welt\"",
"targetBlockTag": "helloworld",
"name": "TEXT",
"to": "Hallo Welt"
}
]
},
{
"name": "LED zum blinken bringen",
"desc": "Blink, blink!",
"instructions": [
{
"text": "Nehme ein \"Wiederhole fortlaufend\" block und ziehe ihn unter den \"Wenn grüne Flagge geklickt\" block",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme ein \"Schalte interne LED an\" block und ziehe ihn unter den \"Wiederhole\" block",
"block": "components_internalledon",
"parentBlock": "control_forever"
},
{
"text": "Baue eine pause mit einem \"warte X sekunden\" block",
"block": "control_wait",
"previousBlock": "components_internalledon"
},
{
"text": "Schalte die LED wieder aus mit einem \"Schalte interne LED aus\" block",
"block": "components_internalledoff",
"previousBlock": "control_wait"
},
{
"text": "Baue eine weitere pause ein.",
"block": "control_wait",
"previousBlock": "components_internalledoff"
},
{
"type": "dialog",
"title": "Warum muss eine weitere Pause eingebaut werden?",
"text": "Eine unendliche Schleife springt sofort zurück. Das heißt die LED wird ausgeschaltet und <b>sofort</b> wieder eingeschaltet.<br>Dadurch erscheint die LED immer an.",
"closeButton": "Ok"
},
{
"type": "quiz",
"question": "Warum muss eine weitere Pause eingebaut werden?",
"answers": [
"Weil sonst die LED explodiert",
"Warum nicht",
"Weil die LED sonst nur an erscheinen würde",
"Damit der Code länger ist"
],
"correct": 2
}
]
},
{
"name": "Externe LED zum blinken bringen",
"desc": "Noch mehr blink, blink!",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/led-wiring.png\">",
"closeButton": "Fertig"
},
{
"type": "dialog",
"title": "Wiederstand",
"text": "Wenn zu viel Strom durch die LED fließt, kann sie durchbrennen!<br>Der Wiederstand limitiert den Strom, und verhindert dadurch das durchbrennen der LED.",
"closeButton": "Ok"
},
{
"text": "Nehme ein \"Wiederhole fortlaufend\" block und ziehe ihn unter den \"Wenn grüne Flagge geklickt\" block",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme ein \"Schalte LED an\" block und ziehe ihn unter den \"Wiederhole\" block",
"block": "components_ledon",
"parentBlock": "control_forever"
},
{
"text": "Baue eine pause mit einem \"warte X sekunden\" block",
"block": "control_wait",
"previousBlock": "components_ledon"
},
{
"text": "Schalte die LED wieder aus mit einem \"Schalte LED aus\" block",
"block": "components_ledoff",
"previousBlock": "control_wait"
},
{
"text": "Baue eine weitere pause ein.",
"block": "control_wait",
"previousBlock": "components_ledoff"
},
{
"type": "quiz",
"question": "Wofür ist der Wiederstand?",
"answers": [
"Erhöht den Strom, damit die LED heller erscheint.",
"Verringert den Strom, damit die LED nicht durchbrennt.",
"Braucht die LED zum funktionieren",
"Der Wiederstand macht garnichts."
],
"correct": 1
}
]
},
{
"name": "LED mit Knopf steuern",
"desc": "Steuere die LED selber!",
"instructions": [
{
"type": "dialog",
"title": "Umgang mit Knöpfen",
"text": "Achtung, beim rein und rausstecken von Knöpfen auf dem Steckbrett kann man sehr einfach die Pins verbiegen.",
"closeButton": "Ok"
},
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/button-wiring.png\">",
"closeButton": "Fertig"
},
{
"text": "Mache erneut eine unendliche Schleife",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme einen \"falls ... sonst\" block",
"block": "control_if_else",
"parentBlock": "control_forever"
},
{
"text": "Ziehe einen \"Ist Knopf gedrückt?\" block in den \"falls ... sonst\" block",
"block": "components_buttonstatus",
"parentBlock": "control_if_else",
"blockTag": "btnpressed"
},
{
"type": "changeblock",
"text": "Ändere die PIN Nummer zu 1",
"targetBlockTag": "btnpressed",
"name": "NUM",
"to": "1"
},
{
"text": "Schalte die LED ein, wenn ja",
"block": "components_ledon",
"parentBlock": "control_if_else",
"parentStack": "SUBSTACK"
},
{
"text": "Schalte die LED aus, wenn nicht",
"block": "components_ledoff",
"parentBlock": "control_if_else",
"parentStack": "SUBSTACK2"
}
]
},
{
"name": "LED mit Poti steuern",
"desc": "Hell! Dunkel!",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/poti-wiring.png\">",
"closeButton": "Fertig"
},
{
"text": "Mache noch eine unendliche Schleife",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme einen \"Setze LED helligkeit\" block",
"block": "components_setledbrightness",
"parentBlock": "control_forever"
},
{
"text": "Nehme einen \"Potentiometer wert\" block",
"block": "components_potentiometer",
"parentBlock": "components_setledbrightness",
"blockTag": "poti"
},
{
"type": "changeblock",
"text": "Gebe den PIN 26 ein",
"targetBlockTag": "poti",
"name": "NUM",
"to": "26"
}
]
},
{
"name": "Fotoresistor",
"desc": "Helligkeit messen",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/photo-wiring.png\">",
"closeButton": "Fertig"
},
{
"text": "Mache noch eine unendliche Schleife",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme einen \"Gebe ... in der Konsole aus\" block",
"block": "debug_print",
"parentBlock": "control_forever"
},
{
"text": "Nehme einen \"Fotoresistor ... Lichtlevel\" block",
"block": "components_photoresistor",
"parentBlock": "debug_print",
"blockTag": "photoresistor"
},
{
"type": "changeblock",
"text": "Gebe den PIN 26 ein",
"targetBlockTag": "photoresistor",
"name": "NUM",
"to": "26"
},
{
"text": "Baue eine pause ein",
"block": "control_wait",
"previousBlock": "debug_print"
},
{
"type": "dialog",
"title": "Ausprobieren",
"text": "Nachdem du den Code gestartet hast, nehme das Kabel und stecke es in die LED rein und schau wie sich der Licht-wert in der Konsole verändert!",
"closeButton": "Ok"
}
]
},
{
"name": "RGB cycle",
"desc": "Discooooooooo!",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/rgb-wiring.png\">",
"closeButton": "Fertig"
},
{
"type": "dialog",
"title": "RGB LED",
"text": "Eine RGB LED kann alle Farben anzeigen. Die RGB LED hat 4 Pins, sie sind wiefolgt belegt: Rot, GND, Grün, Blau. Das lange Bein ist GND. Aus Rot, grün und blau kann man alle Farben mixen.<br>Die RGB LED funktioniert so wie 3 LEDs in einer, eine Rot, eine Grün und eine Blau.",
"closeButton": "Ok"
},
{
"text": "Nehme einen \"Setze LED Helligkeit\" Block",
"block": "components_setledbrightness",
"previousBlock": "event_whenflagclicked",
"blockTag": "firstresetblock"
},
{
"type": "changeblock",
"text": "Setze die Helligkeit zu 0",
"targetBlockTag": "firstresetblock",
"name": "NUM",
"to": "0"
},
{
"type": "comment",
"blockTag": "firstresetblock",
"content": "Zurücksetzen der RGB LED"
},
{
"text": "Nehme noch einen",
"block": "components_setledbrightness",
"previousTag": "firstresetblock",
"blockTag": "secondresetblock"
},
{
"type": "changeblock",
"text": "Nehme den PIN 1",
"targetBlockTag": "secondresetblock",
"name": "NUM",
"to": "1"
},
{
"type": "changeblock",
"text": "Setze die Helligkeit zu 0",
"targetBlockTag": "secondresetblock",
"name": "NUM",
"to": "0"
},
{
"text": "Noch ein Helligkeit Block",
"block": "components_setledbrightness",
"previousTag": "secondresetblock",
"blockTag": "thirdresetblock"
},
{
"type": "changeblock",
"text": "Nehme den PIN 2",
"targetBlockTag": "thirdresetblock",
"name": "NUM",
"to": "2"
},
{
"type": "changeblock",
"text": "Setze die Helligkeit zu 0",
"targetBlockTag": "thirdresetblock",
"name": "NUM",
"to": "0"
},
{
"type": "varcreate",
"text": "Erstelle die Variable \"r\"",
"vartype": "",
"comment": "vartype empty means variable, vartype list means list",
"varTag": "r"
},
{
"text": "Nehme einen \"Setze Variable zu\" Block",
"block": "data_setvariableto",
"previousBlock": "components_setledbrightness",
"blockTag": "setRvar"
},
{
"type": "comment",
"blockTag": "setRvar",
"content": "Setzen der Variablen"
},
{
"text": "Nehme einen \"Wiederhole\" Block",
"block": "control_repeat",
"previousTag": "setRvar",
"blockTag": "rLoop"
},
{
"type": "changeblock",
"text": "Setze die Anzahl zu 255",
"targetBlockTag": "rLoop",
"name": "NUM",
"to": "255"
},
{
"type": "comment",
"blockTag": "rLoop",
"content": "Rot-Schleife"
},
{
"text": "Nehme noch mal einen \"Setze LED Helligkeit\" Block",
"block": "components_setledbrightness",
"parentTag": "rLoop",
"blockTag": "rLoopBrightness"
},
{
"type": "varblock",
"text": "Setze die \"r\" Variable als Helligkeit",
"parentTag": "rLoopBrightness",
"varTag": "r"
},
{
"text": "Nehme einen \"Ändere Variable um\" Block",
"block": "data_changevariableby",
"previousTag": "rLoopBrightness",
"blockTag": "rLoopChange"
},
{
"text": "Baue eine pause ein",
"block": "control_wait",
"previousTag": "rLoopChange",
"blockTag": "rLoopSleep"
},
{
"type": "changeblock",
"text": "Setze den Delay zu 0.01 Sekunden",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "rLoopSleep",
"name": "NUM",
"to": "0.01"
},
{
"type": "varcreate",
"text": "Erstelle die Variable \"g\"",
"vartype": "",
"comment": "vartype empty means variable, vartype list means list",
"varTag": "g"
},
{
"text": "Nehme einen \"Setze Variable zu\" Block, und setze ihn unter den anderen \"Setze Variable zu\" block",
"block": "data_setvariableto",
"previousTag": "setRvar",
"blockTag": "setGvar"
},
{
"text": "Nehme einen \"Wiederhole\" Block",
"block": "control_repeat",
"previousTag": "rLoop",
"blockTag": "gLoop"
},
{
"type": "changeblock",
"text": "Setze die Anzahl zu 255",
"targetBlockTag": "gLoop",
"name": "NUM",
"to": "255"
},
{
"type": "comment",
"blockTag": "gLoop",
"content": "Grün-Schleife"
},
{
"text": "Nehme noch mal einen \"Setze LED Helligkeit\" Block",
"block": "components_setledbrightness",
"parentTag": "gLoop",
"blockTag": "gLoopBrightness"
},
{
"type": "changeblock",
"text": "Nehme den PIN 1",
"targetBlockTag": "gLoopBrightness",
"name": "NUM",
"to": "1"
},
{
"type": "varblock",
"text": "Setze die \"g\" Variable als Helligkeit",
"parentTag": "gLoopBrightness",
"varTag": "g"
},
{
"text": "Nehme einen \"Ändere Variable um\" Block",
"block": "data_changevariableby",
"previousTag": "gLoopBrightness",
"blockTag": "gLoopChange"
},
{
"text": "Baue eine pause ein",
"block": "control_wait",
"previousTag": "gLoopChange",
"blockTag": "gLoopSleep"
},
{
"type": "changeblock",
"text": "Setze den Delay zu 0.01 Sekunden",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "gLoopSleep",
"name": "NUM",
"to": "0.01"
},
{
"type": "varcreate",
"text": "Erstelle die Variable \"b\"",
"vartype": "",
"comment": "vartype empty means variable, vartype list means list",
"varTag": "b"
},
{
"text": "Nehme einen \"Setze Variable zu\" Block, und setze ihn unter den anderen \"Setze Variable zu\" block",
"block": "data_setvariableto",
"previousTag": "setGvar",
"blockTag": "setBvar"
},
{
"text": "Nehme einen \"Wiederhole\" Block",
"block": "control_repeat",
"previousTag": "gLoop",
"blockTag": "bLoop"
},
{
"type": "changeblock",
"text": "Setze die Anzahl zu 255",
"targetBlockTag": "bLoop",
"name": "NUM",
"to": "255"
},
{
"type": "comment",
"blockTag": "bLoop",
"content": "Blau-Schleife"
},
{
"text": "Nehme noch mal einen \"Setze LED Helligkeit\" Block",
"block": "components_setledbrightness",
"parentTag": "bLoop",
"blockTag": "bLoopBrightness"
},
{
"type": "changeblock",
"text": "Nehme den PIN 2",
"targetBlockTag": "bLoopBrightness",
"name": "NUM",
"to": "2"
},
{
"type": "varblock",
"text": "Setze die \"b\" Variable als Helligkeit",
"parentTag": "bLoopBrightness",
"varTag": "b"
},
{
"text": "Nehme einen \"Ändere Variable um\" Block",
"block": "data_changevariableby",
"previousTag": "bLoopBrightness",
"blockTag": "bLoopChange"
},
{
"text": "Baue eine pause ein",
"block": "control_wait",
"previousTag": "bLoopChange",
"blockTag": "bLoopSleep"
},
{
"type": "changeblock",
"text": "Setze den Delay zu 0.01 Sekunden",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "bLoopSleep",
"name": "NUM",
"to": "0.01"
},
{
"type": "quiz",
"question": "Wie funktioniert eine RGB LED?",
"answers": [
"Sie hat 3 LEDs in einer und kann dadurch alle Farben mischen",
"Die LED kann die Farbe des Blitzes anpassen",
"Durch Magie",
"Garnicht"
],
"correct": 0
},
{
"type": "quiz",
"question": "Was ist die Pinbelegung der RGB LED?",
"answers": [
"Cyan, Magenta, Gelb, GND",
"Blau, GND, Rot, Grün",
"Grün, GND, Rot, Blau",
"Rot, GND, Grün, Blau"
],
"correct": 3
}
]
},
{
"name": "Eigene Blöcke",
"desc": "Sehr wichtig fürs Programmieren",
"noclear": true,
"startxml": "<xml xmlns=\"http://www.w3.org/1999/xhtml\"><variables><variable type=\"\" id=\"(}|P`33%1NOiveIj66y9\" islocal=\"false\" iscloud=\"false\">r</variable><variable type=\"\" id=\"?Ap~Lu}C)gM1`s!VT!KY\" islocal=\"false\" iscloud=\"false\">g</variable><variable type=\"\" id=\"m.)raX-J#,hCcD7(O8W(\" islocal=\"false\" iscloud=\"false\">b</variable></variables><block type=\"event_whenflagclicked\" id=\"{!5G[{H3qE2[NMQ;pK)W\" x=\"300\" y=\"400\"><next><block type=\"components_setledbrightness\" id=\"7iMZeHa%[1%8YZjL9hY[\"><comment id=\"~y0sGnp+$t~,PEI4XsOD\" pinned=\"true\" h=\"200\" w=\"200\" x=\"672\" y=\"460\" minimized=\"false\">Zurücksetzen der RGB LED</comment><value name=\"PIN\"><shadow type=\"math_number\" id=\"f+U5Z2LVm}!|}x#T{j^r\"><field name=\"NUM\">0</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"Q/TV4-C6qRh#xeIP;8*k\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"components_setledbrightness\" id=\"0Ca1s%^+$S5gL+7001`V\"><value name=\"PIN\"><shadow type=\"math_number\" id=\"bwt~.%j}4~-O+t-lewu$\"><field name=\"NUM\">1</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"5?NE8e*9$X{hK!RA{u_l\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"components_setledbrightness\" id=\"uNcIV%NaP}YY%uX+Xf=(\"><value name=\"PIN\"><shadow type=\"math_number\" id=\"Mzyv{)k1dVVH#uA:(J21\"><field name=\"NUM\">2</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"*+1-4;:x6{IK0MQCw+]N\"><field name=\"NUM\">0</field></shadow></value><next><block type=\"data_setvariableto\" id=\"9A;/l?=b]9*L+mic**k;\"><field name=\"VARIABLE\" id=\"(}|P`33%1NOiveIj66y9\" variabletype=\"\">r</field><comment id=\"eVd$RW33]|Zz1CY{ozw3\" pinned=\"true\" h=\"200\" w=\"200\" x=\"733\" y=\"590.6666666666666\" minimized=\"false\">Setzen der Variablen</comment><value name=\"VALUE\"><shadow type=\"text\" id=\"*:F;]#IefGV`PTq;-vEa\"><field name=\"TEXT\">0</field></shadow></value><next><block type=\"data_setvariableto\" id=\"S6?Ozvy^J1s!KOJig[V:\"><field name=\"VARIABLE\" id=\"?Ap~Lu}C)gM1`s!VT!KY\" variabletype=\"\">g</field><value name=\"VALUE\"><shadow type=\"text\" id=\"._k^/u_:H,;hU~i$RD?W\"><field name=\"TEXT\">0</field></shadow></value><next><block type=\"data_setvariableto\" id=\"~?eK.,w-Cu|?8fm,cbpQ\"><field name=\"VARIABLE\" id=\"m.)raX-J#,hCcD7(O8W(\" variabletype=\"\">b</field><value name=\"VALUE\"><shadow type=\"text\" id=\"6WYvkt@ZF~xf{NE?@#^S\"><field name=\"TEXT\">0</field></shadow></value><next><block type=\"control_repeat\" id=\"MQjJS[oMVNXDKgiWDNb{\"><comment id=\"2fcs@YMr%NwiR%be`hs8\" pinned=\"true\" h=\"200\" w=\"200\" x=\"753\" y=\"790.6666666666667\" minimized=\"false\">Rot-Schleife</comment><value name=\"TIMES\"><shadow type=\"math_whole_number\" id=\".lWq{$y({/MSZlwg@RfV\"><field name=\"NUM\">255</field></shadow></value><statement name=\"SUBSTACK\"><block type=\"components_setledbrightness\" id=\"GHQh:QtQpaUnrkubKoP)\"><value name=\"PIN\"><shadow type=\"math_number\" id=\"v(v.9:8#+`q#,4*EZ!{B\"><field name=\"NUM\">0</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"O[.r`4-~=#!e{bI~*U[=\"><field name=\"NUM\">255</field></shadow><block type=\"data_variable\" id=\"l#snZo$q/oS*UZv.X#mR\"><field name=\"VARIABLE\" id=\"(}|P`33%1NOiveIj66y9\" variabletype=\"\">r</field></block></value><next><block type=\"data_changevariableby\" id=\"xpuL+JZ;_!Js0ld^zU|w\"><field name=\"VARIABLE\" id=\"(}|P`33%1NOiveIj66y9\" variabletype=\"\">r</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"ceRvr8aHVcF91FO:(({p\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"control_wait\" id=\"|snO1rxN%Am/LCaLM(8b\"><value name=\"DURATION\"><shadow type=\"math_positive_number\" id=\"LMAv]v3@x~NXJl}apkYm\"><field name=\"NUM\">0.01</field></shadow></value></block></next></block></next></block></statement><next><block type=\"control_repeat\" id=\"{cj,aX*d.eZ~9mscQwvD\"><comment id=\"1wur6y=l/k8-|6SrBFX7\" pinned=\"true\" h=\"200\" w=\"200\" x=\"780\" y=\"949.3333333333333\" minimized=\"false\">Grün-Schleife</comment><value name=\"TIMES\"><shadow type=\"math_whole_number\" id=\"#$)1}GAodm}ttR?8`W4Y\"><field name=\"NUM\">255</field></shadow></value><statement name=\"SUBSTACK\"><block type=\"components_setledbrightness\" id=\"5d7$eBwA!r$F,=}Wph/*\"><value name=\"PIN\"><shadow type=\"math_number\" id=\"yTx^(]=$N.O=Lxlobate\"><field name=\"NUM\">1</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"THJO.2;6[smdeV@7=TUG\"><field name=\"NUM\">255</field></shadow><block type=\"data_variable\" id=\"u|/*VSJmTAN_7PbW.pk~\"><field name=\"VARIABLE\" id=\"?Ap~Lu}C)gM1`s!VT!KY\" variabletype=\"\">g</field></block></value><next><block type=\"data_changevariableby\" id=\"-.}{J}aqH2iaNWZPHwe=\"><field name=\"VARIABLE\" id=\"?Ap~Lu}C)gM1`s!VT!KY\" variabletype=\"\">g</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"BuVVq}KT%*MM+wqc+t#D\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"control_wait\" id=\"|,:uI}+DKk%(H(Y/9ywc\"><value name=\"DURATION\"><shadow type=\"math_positive_number\" id=\"7Cf8%v7[K4wX8m-Cc%U)\"><field name=\"NUM\">0.01</field></shadow></value></block></next></block></next></block></statement><next><block type=\"control_repeat\" id=\"@*YAH@0-%8Rasab8bB^g\"><comment id=\"kNik_Va!,pZuBHvLKXKp\" pinned=\"true\" h=\"200\" w=\"200\" x=\"767\" y=\"1173.3333333333333\" minimized=\"false\">Blau-Schleife</comment><value name=\"TIMES\"><shadow type=\"math_whole_number\" id=\"Q@i@}1TEXz`~A9NHtB!z\"><field name=\"NUM\">255</field></shadow></value><statement name=\"SUBSTACK\"><block type=\"components_setledbrightness\" id=\"Oi)Kj62Mz)Cd23sHwR*D\"><value name=\"PIN\"><shadow type=\"math_number\" id=\"uz;wT:hIIkp!{T^a@:sY\"><field name=\"NUM\">2</field></shadow></value><value name=\"BRIGHTNESS\"><shadow type=\"math_number\" id=\"Ba?038mH@`Wh2-}?sMsU\"><field name=\"NUM\">255</field></shadow><block type=\"data_variable\" id=\"*ol#Vs;$5;PgTB3|%V@a\"><field name=\"VARIABLE\" id=\"m.)raX-J#,hCcD7(O8W(\" variabletype=\"\">b</field></block></value><next><block type=\"data_changevariableby\" id=\"9zAN(=gY!DO[Ap8VCm90\"><field name=\"VARIABLE\" id=\"m.)raX-J#,hCcD7(O8W(\" variabletype=\"\">b</field><value name=\"VALUE\"><shadow type=\"math_number\" id=\"A_V:hc~.%5Rm+{_QnXI^\"><field name=\"NUM\">1</field></shadow></value><next><block type=\"control_wait\" id=\"mkjILpIL{Dq#atg@T`.P\"><value name=\"DURATION\"><shadow type=\"math_positive_number\" id=\"P~BBP;n-w3w2O:)I8H`=\"><field name=\"NUM\">0.01</field></shadow></value></block></next></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></xml>",
"varTags": {
"r": "(}|P`33%1NOiveIj66y9",
"g": "?Ap~Lu}C)gM1`s!VT!KY",
"b": "m.)raX-J#,hCcD7(O8W("
},
"blockTags": {
"firstresetblock": "7iMZeHa%[1%8YZjL9hY[",
"secondresetblock": "0Ca1s%^+$S5gL+7001`V",
"thirdresetblock": "uNcIV%NaP}YY%uX+Xf=(",
"setRvar": "9A;/l?=b]9*L+mic**k;",
"rLoop": "MQjJS[oMVNXDKgiWDNb{",
"rLoopBrightness": "GHQh:QtQpaUnrkubKoP)",
"rLoopChange": "xpuL+JZ;_!Js0ld^zU|w",
"rLoopSleep": "|snO1rxN%Am/LCaLM(8b",
"setGvar": "S6?Ozvy^J1s!KOJig[V:",
"gLoop": "{cj,aX*d.eZ~9mscQwvD",
"gLoopBrightness": "5d7$eBwA!r$F,=}Wph/*",
"gLoopChange": "-.}{J}aqH2iaNWZPHwe=",
"gLoopSleep": "|,:uI}+DKk%(H(Y/9ywc",
"setBvar": "~?eK.,w-Cu|?8fm,cbpQ",
"bLoop": "@*YAH@0-%8Rasab8bB^g",
"bLoopBrightness": "Oi)Kj62Mz)Cd23sHwR*D",
"bLoopChange": "9zAN(=gY!DO[Ap8VCm90",
"bLoopSleep": "mkjILpIL{Dq#atg@T`.P"
},
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/rgb-wiring.png\">",
"closeButton": "Fertig"
},
{
"type": "dialog",
"title": "WIP",
"text": "Diese Aufgabe enthält Schritte, welche noch besser durchgetestet werden müssen. Es kann sein das die Aufgabe rot wird, aber nix passiert, es kann sein das Sachen noch nicht richtig funktionieren.<br>Bei dieser Aufgabe sind bereits Blöcke vorhanden. Das ist richtig so.",
"closeButton": "Ok"
},
{
"type": "customblock",
"text": "Erstelle einen neuen Block für \"LED cycle\", mit einem argument \"pin\"",
"args": 1,
"blockTag": "ledcycle"
},
{
"type": "delete",
"text": "Lösche alles ab der zweiten Schleife",
"targetBlockTag": "gLoop"
},
{
"type": "varcreate",
"text": "Erstelle eine neue Variable \"c\"",
"vartype": "",
"comment": "vartype empty means variable, vartype list means list",
"varTag": "c"
},
{
"type": "changeblock",
"text": "Setze die Variable von \"Setze (r) auf (0)\" zu c",
"targetBlockTag": "setRvar",
"name": "VARIABLE",
"valueVarTag": "c"
},
{
"type": "move",
"text": "Bewege die erste Schleife zum \"LED cycle\" Block",
"fromBlockTag": "rLoop",
"toPreviousBlockTag": "ledcycle"
},
{
"type": "customblockarg",
"text": "Nehme das Argument \"pin\" und ziehe es in das erste Argument vom \"Setze LED Helligkeit\" Block",
"parentTag": "rLoopBrightness"
},
{
"type": "changeblock",
"text": "Setze die Variable von \"Ändere (r) um (1)\" zu c",
"targetBlockTag": "rLoopChange",
"name": "VARIABLE",
"valueVarTag": "c"
},
{
"type": "delete",
"text": "Lösche alles nach dem \"Setze (c) auf (0)\" Block",
"targetBlockTag": "setGvar"
},
{
"type": "move",
"text": "Bewege den Setze Variable Block zum \"LED cycle\" Block",
"fromBlockTag": "setRvar",
"toPreviousBlockTag": "ledcycle"
},
{
"type": "varblock",
"text": "Setze die \"c\" Variable als Helligkeit in der Schleife",
"parentTag": "rLoopBrightness",
"varTag": "c"
},
{
"type": "customblockcall",
"text": "Nehme deinen Block",
"previousTag": "thirdresetblock",
"targetBlockTag": "rgbcycle",
"blockTag": "firstcall"
},
{
"type": "changeblock",
"text": "Setze das Argument zu 0",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "firstcall",
"name": "TEXT",
"to": "0"
},
{
"type": "customblockcall",
"text": "Nehme deinen Block nochmal",
"previousTag": "firstcall",
"targetBlockTag": "rgbcycle",
"blockTag": "secondcall"
},
{
"type": "changeblock",
"text": "Setze das Argument zu 1",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "secondcall",
"name": "TEXT",
"to": "1"
},
{
"type": "customblockcall",
"text": "Nehme deinen Block noch einmal",
"previousTag": "secondcall",
"targetBlockTag": "rgbcycle",
"blockTag": "thirdcall"
},
{
"type": "changeblock",
"text": "Setze das Argument zu 2",
"todo": "Allow varTags to be embedded into the text element, so it shows as the users' custom name",
"targetBlockTag": "thirdcall",
"name": "TEXT",
"to": "2"
}
]
},
{
"name": "Ultraschall Sensor",
"desc": "Beep! Boop! 36cm Abstand!",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/ultrasonic-wiring.png\">",
"closeButton": "Fertig"
},
{
"type": "dialog",
"title": "Ultraschallsensor",
"text": "Ein Ultraschallsensor kann Distanzen in cm messen. Das funktioniert indem der Ultraschallsensor einen Ultraschall sendet, und misst wie lange es dauert bis der Schall aufprallt und zurück kommt.<br>Die Pins auf dem Ultraschallsensor sind so belegt: 3.3V, Trigger, Echo, GND. 3.3V wird mit Strom verbunden (3.3 Volt vom Pico), wir senden ein sehr kurzes Stromsignal bei Trigger, um den Ultraschallsensor zu sagen, das er messen soll.<br>Der Ultraschallsensor sendet dann ein kurzes Echo Stromsignal wenn der Schall zurück kam. GND ist Ground, der Strom muss wieder zurückfließen damit der Stromkreis funktioniert.<br>Das ist aber alles nicht umbedingt hier wichtig, weil all das unter einem < Ultraschall Distanz > Block ist",
"closeButton": "Ok"
},
{
"text": "Nehme eine unendliche Schleife",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme einen \"Gebe ... in der Konsole aus\" block",
"block": "debug_print",
"parentBlock": "control_forever"
},
{
"text": "Nehme einen \"verbinde ... und ...\" block",
"block": "operator_join",
"parentBlock": "debug_print",
"blockTag": "join"
},
{
"text": "Nehme einen \"Ultraschall Distanz\" Block",
"block": "components_ultrasonic",
"parentBlock": "operator_join",
"blockTag": "ultrasonic"
},
{
"type": "changeblock",
"text": "Setze den Echo-PIN zu 1",
"targetBlockTag": "ultrasonic",
"name": "NUM",
"to": "1"
},
{
"type": "changeblock",
"text": "Setze den zweiten Wert zu \"cm\"",
"targetBlockTag": "join",
"name": "TEXT",
"to": "cm"
},
{
"text": "Baue eine pause ein",
"block": "control_wait",
"previousBlock": "debug_print"
},
{
"type": "quiz",
"question": "Was ist die Pinbelegung vom Ultraschallsensor?",
"answers": [
"GND, Trigger, Echo, GND",
"3.3V, Trigger, Echo, GND",
"3.3V, Echo, Trigger, GND",
"GND, Echo, Trigger, GND"
],
"correct": 1
},
{
"type": "quiz",
"question": "Wie funktioniert ein Ultraschallsensor",
"answers": [
"Er hat ein Lineal eingebaut",
"Er sendet einen Schall und kann durch die Tonfrequenz den Abstand messen",
"Er sendet einen Schall und wartet bis er zurück kommt",
"Er sendet einen Schall, das Objekt wo es Abprallt sagt dem Sensor die Distanz"
],
"correct": 2
}
]
},
{
"name": "PIR Sensor",
"desc": "Bewegung erkannt!",
"instructions": [
{
"type": "dialog",
"title": "Wiring",
"text": "Stecke auf dem Steckbrett:<br><img width=\"80%\" src=\"PICOSCRATCHSERVER/img/pir-wiring.png\">",
"closeButton": "Fertig"
},
{
"type": "dialog",
"title": "PIR Sensor",
"text": "Ein PIR Sensor kann Bewegungen erkennen. Die Pins auf dem PIR Sensor sind so belegt: GND, Data, 3.3V. 3.3V wird mit Strom verbunden (3.3 Volt vom Pico).<br>Der PIR Sensor sendet ein Stromsignal bei Data, wenn er bewegung erkennt. GND ist Ground.",
"closeButton": "Ok"
},
{
"text": "Nehme eine unendliche Schleife",
"block": "control_forever",
"previousBlock": "event_whenflagclicked"
},
{
"text": "Nehme einen \"falls ... sonst\" block",
"block": "control_if_else",
"parentBlock": "control_forever"
},
{
"text": "Ziehe einen \"PIR Sensor Erkennung\" block in den \"falls ... sonst\" block",
"block": "components_pir",
"parentBlock": "control_if_else",
"blockTag": "pir"
},
{
"type": "changeblock",
"text": "Ändere die PIN Nummer zu 26",
"targetBlockTag": "pir",
"name": "NUM",
"to": "26"
},
{
"text": "Schalte die LED ein, wenn ja",
"block": "components_ledon",
"parentBlock": "control_if_else",
"parentStack": "SUBSTACK"
},
{
"text": "Schalte die LED aus, wenn nicht",
"block": "components_ledoff",
"parentBlock": "control_if_else",
"parentStack": "SUBSTACK2"
}
]
}
]