![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Starting point for the exercise in the IoT workshop
main.h@1:d61cfd0e12a2, 2019-02-26 (annotated)
- Committer:
- marcozecchini
- Date:
- Tue Feb 26 19:08:19 2019 +0000
- Revision:
- 1:d61cfd0e12a2
- Parent:
- 0:66a70b507959
Starting point for the exercise
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
marcozecchini | 0:66a70b507959 | 1 | #include "mbed.h" |
marcozecchini | 0:66a70b507959 | 2 | #include <stdlib.h> |
marcozecchini | 0:66a70b507959 | 3 | #include <string> |
marcozecchini | 0:66a70b507959 | 4 | #define TURN 5 |
marcozecchini | 0:66a70b507959 | 5 | |
marcozecchini | 0:66a70b507959 | 6 | using namespace std; |
marcozecchini | 0:66a70b507959 | 7 | |
marcozecchini | 0:66a70b507959 | 8 | typedef struct question { |
marcozecchini | 0:66a70b507959 | 9 | string answer; |
marcozecchini | 0:66a70b507959 | 10 | //Do you need a specific type to show the question and keep track of how they are shown? |
marcozecchini | 0:66a70b507959 | 11 | } question_t; |
marcozecchini | 0:66a70b507959 | 12 | |
marcozecchini | 0:66a70b507959 | 13 | //Global variable |
marcozecchini | 0:66a70b507959 | 14 | string questions = "When was Linux invented? ; 1991 ; 2005 ; 1965 ; 1999!Which one of the following is NOT open source? ; Skype ; Docker ; Python ; PHP ; LibreOffice!What does the 'A' stand for in the term LAMP stack? ; Apache ; Ajax ; ActiveX ; ASP.NET!Firefox was made by what community? ; Mozilla ; Apple ; IBM ; Oracle!What animal is Tux, the Linux mascot? ; Penguin ; Mouse ; Horse ; Spider!Which Linux OS is commonly recommended for beginners? ; Ubuntu ; Gentoo ; FreeBSD ; Fedora!What is Audacity used for? ; Audio ; Art ; Programming ; Gaming!Which one of the following is open source? ; MySQL ; Windows ; iTunes ; Photoshop!What language was the Linux kernel written in? ; C ; Java ; C++ ; Ruby!Which one of the following is an open source license? ; GPL ; FTP ; GUID ; API!"; |
marcozecchini | 0:66a70b507959 | 15 | string read_questions = ""; |
marcozecchini | 0:66a70b507959 | 16 | //Other? |
marcozecchini | 0:66a70b507959 | 17 | |
marcozecchini | 0:66a70b507959 | 18 | //Auxiliary functions |
marcozecchini | 0:66a70b507959 | 19 | string readline_questions(); //To read each question from the "questions" variable |
marcozecchini | 0:66a70b507959 | 20 | string readline_serial(); //To read a line from the serial channel |
marcozecchini | 0:66a70b507959 | 21 | void parse_line(string line, question_t *res); //To parse properly the question |
marcozecchini | 0:66a70b507959 | 22 | //Other? |