-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tutorial): add new tutorial patches for sections "hardware" and …
…"patterns"
- Loading branch information
Showing
18 changed files
with
1,824 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
{ | ||
"comments": [ | ||
{ | ||
"content": "# Working with Hardware\n\nIn this section of the tutorial, you learn how to upload the program onto the board and work with hardware modules.\n\nTo upload programs to the Arduino, you need to [install the desktop version](https://xod.show/downloads/) of XOD. The browser version does not have permission to access the USB ports. Although you’re still able to upload XOD programs even from the browser version if you have the original Arduino IDE installed ([learn how](https://xod.io/docs/tutorial/02-deploy/?utm_source=ide&utm_medium=ide_comment&utm_campaign=tutorial_02)).\n\nIf you have no hardware,\nskip to `200-patterns` section and replace 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-tmp36" | ||
}, | ||
{ | ||
"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" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. You'll see a built-in blinking LED.\n\n## Instructions\n\n1. Connect the Arduino to your computer.\n\n2. Upload the program. To do this, select Deploy → Upload to Arduino from the main menu or click lightening icon in the deployment pane below.\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" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"comments": [ | ||
{ | ||
"content": "# Interactive Session\n\nAs you run a simulation, you can run the interactive session, using `tweak`s and `watch`es, while running the program on the Arduino.\n\n## Instructions\n\n1. Connect the Arduino to your computer.\n\n2. Upload the program with an interactive session. To do this, select Deploy → Upload to Arduino from the main menu and mark \"Debug after upload\" checkbox or just click \"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 Arduino reacts to these changes.\n\nTo stop the interactive session press \"Stop\" button above, on the green panel. 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 the puls.", | ||
"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" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 let's 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 a value of 1 denotes full brightness.\n\nHowever, you can adjust brightness level by setting values *between* 0 and 1 to the `LUM` pin.\n\nNote that LED can change the brightness only in the PWM output of your board. 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](https://xod.io/docs/tutorial/02-deploy/?utm_source=ide&utm_medium=ide_comment&utm_campaign=tutorial_02), 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 `tweak-boolean` node with `tweak-number`.\n\n4. Upload the program with an interactive session.\n\n5. Change the value of the `tweak-number` in the range from 0 to 1 and see how the brightness of the LED is changing.", | ||
"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" | ||
} | ||
] | ||
} |
Oops, something went wrong.