Tags:
view all tags
---+ Solutions to the exercises This is the page to which the solutions will be uploaded. These will mainly consist of gzipped tar files which you can download and unpack. For the exercise on Linux the are no solutions as these are simple Linux commands to be executed into the bash command interpreter.<br /><br /> * <b>Solutions to exercise 1: Linux Commands</b><br />There are no solutions to this exercise. We simply try out a series of bash commands * *Solutions to exercise 2*: __C programming:__ %ATTACHURL%/solEx2.tar.gz<br /><br /> * <b>Solutions to exercise 3: Programming Tools</b><br />Even though there are no solutions to exercise3: _Compilations Tools_, here are a few Makefile examples nevertheless: %ATTACHURL%/makeExamples.tar.gz<br /><br /> * <b>Solutions to exercise 4: Raspberry Pi<br /></b>There are no solutions to this exercise session because we only use programs that have already been written before.<br /><br /> * <b>Solutions to exercise 4: LED<br /></b><br />For the mygpio program, these are the tests you must perform in order to make the program safe against wrong input from the user * test if the user has given at least 2 arguments namely a string, which should be "read" or "write" and the pin number<br />(argv may not be smaller than 3) * check if argv[1] is either "read" or "write". Use strcmp to accomplish this * if argv[1] is "read", make sure argc is exactly 3 * 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<br />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 -- %USERSIG{UliRaich - 2017-10-14}% ---++ Comments %COMMENT%
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
gz
makeExamples.tar.gz
r1
manage
1.7 K
2017-10-14 - 12:59
UnknownUser
gz
solEx2.tar.gz
r1
manage
798.9 K
2017-10-14 - 12:53
UnknownUser
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r18
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 2017-10-23
-
uli
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
Embedded_Systems Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback