Difference: SolutionsToTheExercises (2 vs. 3)

Revision 32017-10-26 - uli

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Solutions to the exercises

Line: 18 to 18
 
    • 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
Changed:
<
<
    • 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

  • Solutions to the exercises on files, pipes and sockets

    These exercises have been skipped 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/communication.tar.gz

  • Solutions to exercise 5: The DHT11 temperature and humidity sensor

    The code contains an example of how to write a shared library. You can collect all libraries for your course in a common directory (.g. /opt/ucc/lib) as you do for all corresponding include files (/opt/ucc/include). Then you make the directory of libraries globally known to the system by putting a file ucc.conf into /etc/ld.so.conf. ucc.conf simply contains the text /opt/ucc/lib. Finally you run the command sudo ldconf and /opt/ucc/lib will be added to the search path of shared libraries on the system
  -- Uli Raich - 2017-10-14
Line: 28 to 31
 
META FILEATTACHMENT attachment="solEx2.tar.gz" attr="" comment="" date="1507985585" name="solEx2.tar.gz" path="solEx2.tar.gz" size="818105" user="uli" version="1"
META FILEATTACHMENT attachment="makeExamples.tar.gz" attr="" comment="" date="1507985978" name="makeExamples.tar.gz" path="makeExamples.tar.gz" size="1714" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="communication.tar.gz" attr="" comment="" date="1509006291" name="communication.tar.gz" path="communication.tar.gz" size="128" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 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