Skip to content

Commit

Permalink
feat(tutorial): add new tutorial patches for sections "hardware" and …
Browse files Browse the repository at this point in the history
…"patterns"
  • Loading branch information
brusherru committed Apr 3, 2019
1 parent 4ce76e6 commit 11504fb
Show file tree
Hide file tree
Showing 23 changed files with 2,465 additions and 0 deletions.
124 changes: 124 additions & 0 deletions workspace/welcome-to-xod/100-hardware/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"comments": [
{
"content": "# Working with Hardware\n\nIn this part of the tutorial, you learn how to upload the program to the board and work with hardware modules.\n\nTo upload programs to Arduino, you need to [install the desktop version](https://xod.show/downloads/) of XOD. The browser version does not have permissions to access USB ports. Nevertheless, you can upload XOD programs even from the browser version if you have the original Arduino IDE installed by [copying and pasting the generated code](#TODO).\n\nIf you have no hardware on hand, skip to `200-patterns` section and go on replacing hardware nodes with `watch`es and `tweak`s.",
"id": "S1x6FBAP4",
"position": {
"units": "slots",
"x": 0,
"y": 0
},
"size": {
"height": 4,
"units": "slots",
"width": 7
}
},
{
"content": "## Table of Contents\n",
"id": "rJ84qrRwV",
"position": {
"units": "slots",
"x": 9,
"y": 0
},
"size": {
"height": 1,
"units": "slots",
"width": 7
}
}
],
"nodes": [
{
"id": "HJgVY6kOV",
"position": {
"units": "slots",
"x": 13,
"y": 1
},
"type": "@/103-led"
},
{
"id": "Hy3Vt6kdE",
"position": {
"units": "slots",
"x": 11,
"y": 2
},
"type": "@/106-servo"
},
{
"id": "S1gStak_E",
"position": {
"units": "slots",
"x": 15,
"y": 2
},
"type": "@/108-text-lcd"
},
{
"id": "SkMBtpkd4",
"position": {
"units": "slots",
"x": 9,
"y": 3
},
"type": "@/109-thermometer"
},
{
"id": "Sy2mt6yO4",
"position": {
"units": "slots",
"x": 9,
"y": 1
},
"type": "@/101-upload"
},
{
"id": "rJJEKTJd4",
"position": {
"units": "slots",
"x": 11,
"y": 1
},
"type": "@/102-interactive"
},
{
"id": "rJb4Y6Ju4",
"position": {
"units": "slots",
"x": 15,
"y": 1
},
"type": "@/104-button"
},
{
"id": "rkiEKa1dE",
"position": {
"units": "slots",
"x": 9,
"y": 2
},
"type": "@/105-pot"
},
{
"id": "ry4Htp1u4",
"position": {
"units": "slots",
"x": 11,
"y": 3
},
"type": "@/110-ldr"
},
{
"id": "ryANFp1_4",
"position": {
"units": "slots",
"x": 13,
"y": 2
},
"type": "@/107-manipulator"
}
]
}
74 changes: 74 additions & 0 deletions workspace/welcome-to-xod/101-upload/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"comments": [
{
"content": "# Upload the Program\n\nLet's upload this patch to the Arduino board to see the built-in LED blinking.\n\n## Instructions\n\n1. Connect the Arduino board to your computer.\n\n2. Upload the program. To do this, hit Deploy → Upload to Arduino from the main menu or click the lightning icon in the deployment pane at the bottom of the screen.\n\n## Additional Exercise\n\nChange the `IVAL` value on the `clock` node and upload the program again. See how the blinking frequency of the LED changes.",
"id": "SkxcsVCvV",
"position": {
"units": "slots",
"x": -2,
"y": 0
},
"size": {
"height": 4,
"units": "slots",
"width": 7
}
}
],
"links": [
{
"id": "B16rcECPN",
"input": {
"nodeId": "H1iH5ERv4",
"pinKey": "ryTIROHwkW"
},
"output": {
"nodeId": "B1dBcNADN",
"pinKey": "HJU8CE2lW"
}
},
{
"id": "BkgLcN0vV",
"input": {
"nodeId": "HJyLcNCvV",
"pinKey": "HyYh1a3LZ"
},
"output": {
"nodeId": "H1iH5ERv4",
"pinKey": "HkyxURuSPyW"
}
}
],
"nodes": [
{
"id": "B1dBcNADN",
"position": {
"units": "slots",
"x": 8,
"y": 1
},
"type": "xod/core/clock"
},
{
"id": "H1iH5ERv4",
"position": {
"units": "slots",
"x": 7,
"y": 2
},
"type": "xod/core/flip-flop"
},
{
"boundLiterals": {
"B1oqkTnIb": "D13"
},
"id": "HJyLcNCvV",
"position": {
"units": "slots",
"x": 6,
"y": 3
},
"type": "xod/common-hardware/led"
}
]
}
68 changes: 68 additions & 0 deletions workspace/welcome-to-xod/102-interactive/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"comments": [
{
"content": "# Interactive Session\n\nAs you run the simulation, you can run an *interactive session*. Tweaks and watches go live while running the program on an Arduino board.\n\n## Instructions\n\n1. Connect the Arduino board to your computer.\n\n2. Upload the program with the interactive session enabled. To do this, select Deploy → Upload to Arduino from the main menu and check \"Debug after upload\" or click the \"bug\" icon in the deployment pane below.\n\n3. After the interactive session has been started, select `tweak-boolean` and change its value. The built-in LED on the board reacts to these changes.\n\nTo stop the interactive session press \"Stop\" button on the green panel above. To start the interactive session again, you have to upload the program again.",
"id": "Syx5p6EAv4",
"position": {
"units": "slots",
"x": 0,
"y": 0
},
"size": {
"height": 5,
"units": "slots",
"width": 7
}
},
{
"content": "## Additional Exercise\n\nPlace `tweak-pulse` and link it with `UPD` pin and start the interactive session again. Now your LED changes the brightness only after you send a pulse.",
"id": "r1bznrRDN",
"position": {
"units": "slots",
"x": 12,
"y": 2
},
"size": {
"height": 2,
"units": "slots",
"width": 5
}
}
],
"links": [
{
"id": "rkLIoHAPE",
"input": {
"nodeId": "r1ZP7AE0DN",
"pinKey": "HyYh1a3LZ"
},
"output": {
"nodeId": "SJ78sSRPV",
"pinKey": "Sk1e_NIVE"
}
}
],
"nodes": [
{
"id": "SJ78sSRPV",
"position": {
"units": "slots",
"x": 9,
"y": 2
},
"type": "xod/debug/tweak-boolean"
},
{
"boundLiterals": {
"B1oqkTnIb": "D13"
},
"id": "r1ZP7AE0DN",
"position": {
"units": "slots",
"x": 8,
"y": 3
},
"type": "xod/common-hardware/led"
}
]
}
68 changes: 68 additions & 0 deletions workspace/welcome-to-xod/103-led/patch.xodp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"comments": [
{
"content": "# LED Node\n\nYou already made a blinking LED and controlled it in the interactive session. Let's examine how it works and play with its brightness.\n\nThe `LUM` pin on the `led` node accepts values between 0 and 1. The 0 value represents no glow at all, while the value of 1 denotes the full brightness.\n\nYou can set an intermediate brightness level by setting values *between* 0 and 1 to the `LUM` pin.\n\nNote that LED can change the brightness only if connected to a board pin which supports PWM. If you have an Arduino board, find out the port number with the leading \"~\" symbol.",
"id": "BJfDq3B0DE",
"position": {
"units": "slots",
"x": 0,
"y": 0
},
"size": {
"height": 5,
"units": "slots",
"width": 7
}
},
{
"content": "## Instructions\n\n1. Assemble a circuit according to the [scheme](#TODO), and connect the Arduino to your computer.\n\n2. Set the value of the `PORT` pin to `D11`. Leading \"D\" means that it's a digital port.\n\n3. Replace the `tweak-boolean` node with `tweak-number`.\n\n4. Upload the program with the interactive session enabled.\n\n5. Change the value of `tweak-number` in the range from 0 to 1 and see how the brightness of the LED changes.",
"id": "ryhJWc0P4",
"position": {
"units": "slots",
"x": 12,
"y": 1
},
"size": {
"height": 4,
"units": "slots",
"width": 5
}
}
],
"links": [
{
"id": "BybD5nH0wN",
"input": {
"nodeId": "Byw5hBADE",
"pinKey": "HyYh1a3LZ"
},
"output": {
"nodeId": "B1xDqnBCvV",
"pinKey": "Sk1e_NIVE"
}
}
],
"nodes": [
{
"id": "B1xDqnBCvV",
"position": {
"units": "slots",
"x": 9,
"y": 2
},
"type": "xod/debug/tweak-boolean"
},
{
"boundLiterals": {
"B1oqkTnIb": "D13"
},
"id": "Byw5hBADE",
"position": {
"units": "slots",
"x": 8,
"y": 3
},
"type": "xod/common-hardware/led"
}
]
}
Loading

0 comments on commit 11504fb

Please sign in to comment.