|
META TOPICPARENT |
name="WebHome" |
Solutions to the exercises |
|
-
- if argv[1] is "write", make sure argc is exactly 4
- convert the pin number from string to integer. You may be tempted to use atoi() but you must not, because atoi() does not check for conversion errors. Use strtol() instead.
- Make sure the converted pin number is in the range 0..7
For the "read" case we are done with our checks here
|
|
< < |
-
- for the "write" case convert the logic level and make sure you get either 0 or 1
|
> > |
-
- for the "write" case convert the logic level and make sure you get either 0 or 1
|
| https://iotworkshop.africa/pub/Embedded_Systems/SolutionsToTheExercises/leds.tar.gz
|
|
> > |
In addition to the solutions on the Raspberry Pi I wrote a simple Qt GUI:
https://iotworkshop.africa/pub/Embedded_Systems/SolutionsToTheExercises/QtLED.tar.gz |
|
- Solutions to the exercises on switches
These exercises have also been skipped because of lack of time but I attach the solution codes nevertheless such that you can have a look at them and/or use them in a future course
https://iotworkshop.africa/pub/Embedded_Systems/SolutionsToTheExercises/switches.tar.gz |
|
META FILEATTACHMENT |
attachment="pigpiod" attr="" comment="" date="1509556508" name="pigpiod" path="pigpiod" size="3299" user="uli" version="1" |
META FILEATTACHMENT |
attachment="bcm2835-1.52.tar.gz" attr="" comment="" date="1509696255" name="bcm2835-1.52.tar.gz" path="bcm2835-1.52.tar.gz" size="640761" user="uli" version="1" |
META FILEATTACHMENT |
attachment="pulseGen_bcm2835.tar.gz" attr="" comment="" date="1509696255" name="pulseGen_bcm2835.tar.gz" path="pulseGen_bcm2835.tar.gz" size="8168" user="uli" version="1" |
|
|
> > |
META FILEATTACHMENT |
attachment="QtLED.tar.gz" attr="" comment="" date="1510165414" name="QtLED.tar.gz" path="QtLED.tar.gz" size="3323125" user="uli" version="1" |
|