Guides: Introduce C Tutorial
Contribution description
This is the first wave ~~of many~~ that introduce brand new beginner tutorials to RIOT. The aim of this PR is to introduce the C Tutorials covering some of the most basic things from Threads to GPIO.
Testing procedure
Every tutorial within this PR is covered by an example that is 1:1 reproducible by following the tutorial. This means that all guides are cross-checked with the linked examples and all examples are built as usual which should avoid long term de-synchronization.
Issues/PRs references
Disclaimer: This depends on #21404!
This also depends on #21436
I have decided to make a different PR the head of this Tutorial wave as it made more sense chronologically. I will convert this into a draft till the other PR has been merged/is close to it.
Murdock results
:heavy_check_mark: PASSED
8cdb2d94118018e64fc8f27242e3942e4aa3136e doc/guides: Riot Tutorial
| Success | Failures | Total | Runtime |
|---|---|---|---|
| 109 | 0 | 109 | 02m:33s |
Artifacts
One day I will PR something without whitespace issues, today isn't that day :stuck_out_tongue:
I rebased the branch now that both parents have been merged and this PR should be reviewable :smile:
Use this one weird trick, to save ~46 MB of data! You might also use AV1 instead of x265, as @bergzand suggested. It's royalty free.
cd doc/guides/c_tutorials/img/gpio/ // Reduce filesize by 99.34% ffmpeg -i 05_working_video.mp4 -filter:v scale=1080:-2 output.mp4 ffmpeg -i output.mp4 -vf "crop=1080:1300:0:0" -vcodec libx265 -crf 28 output2.mp4 mv output2.mp4 05_working_video.mp4 rm output.mp4 // Reduce by 81.35% ffmpeg -i 08_buttons.mp4 -vcodec libx265 -crf 28 output.mp4 mv output.mp4 08_buttons.mp4 // For asthetics ffmpeg -i 04_code.png -vf "crop=772:450:0:0" 04_code2.png mv 04_code2.png 04_code.pngNot done with the review yet. I don't know if I am a fan of screenshots from VSCode? What do they add of value? Showing the code? We can do just that without an image.
Ty for the commands. When I initially wrote that guide I was thinking of some people that barely had any experience with vscode and needed some visual guidance to understand what they are even doing in vscode (As happened in the riot uni project) but the screenshots also add a really annoying maintenance burden when you change something so I'm not really against removing them.
As a small info as to why the PR is currently stale, I'm trying to get my bachelor's project to a point where I can confidently register it without fearing the deadline, I will come back to this after that (Hopefully soon-ish).
The C files miss copyright headers
Added Copyright Headers & Squashed :+1:
Ty for the review :saluting_face:
Looks like I was sloppy during the review. Sorry. The files were marked as reviewed - so I thought I finished, but that clearly wasn't the case.
I ran the make generate-Makefile.ci command for the new examples and this is the result:
chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ git status
Auf Branch introduce_tutorials
Unversionierte Dateien:
(benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
gpio/Makefile.ci
saul/Makefile.ci
threads/Makefile.ci
nichts zum Commit vorgemerkt, aber es gibt unversionierte Dateien
(benutzen Sie "git add" zum Versionieren)
chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat gpio/Makefile.ci
BOARD_INSUFFICIENT_MEMORY := \
atmega8 \
nucleo-l011k4 \
#
chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat saul/Makefile.ci
BOARD_INSUFFICIENT_MEMORY := \
atmega8 \
#
chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat threads/Makefile.ci
BOARD_INSUFFICIENT_MEMORY := \
nucleo-l011k4 \
#
Looks like I was sloppy during the review. Sorry. The files were marked as reviewed - so I thought I finished, but that clearly wasn't the case.
Im also to blame, I should have retroactively applied the requested changes from #21545 here now that I know more about the formatting guidelines :sweat_smile:
I used this as a chance to improve the explanations of the examples with a lot more comments, better to do it now than later :+1:
I ran the
make generate-Makefile.cicommand for the new examples and this is the result:chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ git status Auf Branch introduce_tutorials Unversionierte Dateien: (benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken) gpio/Makefile.ci saul/Makefile.ci threads/Makefile.ci nichts zum Commit vorgemerkt, aber es gibt unversionierte Dateien (benutzen Sie "git add" zum Versionieren) chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat gpio/Makefile.ci BOARD_INSUFFICIENT_MEMORY := \ atmega8 \ nucleo-l011k4 \ # chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat saul/Makefile.ci BOARD_INSUFFICIENT_MEMORY := \ atmega8 \ # chris@ThinkPias:~/RIOTstuff/riot-c-guide/RIOT/examples/guides$ cat threads/Makefile.ci BOARD_INSUFFICIENT_MEMORY := \ nucleo-l011k4 \ #
I dont really understand what that means :sweat_smile:
This PR should now be ready for re-review :+1: Ty for all the feedback
I ran the
make generate-Makefile.cicommand for the new examples and this is the result:I dont really understand what that means 😅
The merge failed because the nucleo-l011k4 has insufficient memory for some of the examples. In order to avoid this error, you can define a Makefile.ci file for each of the examples which declares boards that have insufficient memory.
I did that for your examples and posted the results. Three files were generated and I printed the contents of the files, so you can copy&paste them. In the review-mode of Github I can't propose a new file (I think?), therefore this way.
Looks like I was sloppy during the review. Sorry. The files were marked as reviewed - so I thought I finished, but that clearly wasn't the case.
Im also to blame, I should have retroactively applied the requested changes from #21545 here now that I know more about the formatting guidelines 😅
Blame is a strong word in this case. You always learn something new, but you can't (or shouldn't) reiterate old code every time you learn something new. Then you'd never get done 😅
I ran the
make generate-Makefile.cicommand for the new examples and this is the result:I dont really understand what that means 😅
The merge failed because the
nucleo-l011k4has insufficient memory for some of the examples. In order to avoid this error, you can define aMakefile.cifile for each of the examples which declares boards that have insufficient memory.I did that for your examples and posted the results. Three files were generated and I printed the contents of the files, so you can copy&paste them. In the review-mode of Github I can't propose a new file (I think?), therefore this way.
This should now also be fixed :pray:
This should cover all your review feedback :pray:
The two holy words everyone wants to hear, ty :partying_face:
The two holy words everyone wants to hear, ty 🥳
"Changes Requested", yeah you can have that too 😈
He giveth and he taketh away :church: