Starting point for the exercise in the IoT workshop

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.h Source File

main.h

00001 #include "mbed.h"
00002 #include <stdlib.h>
00003 #include <string>
00004 #define TURN 5
00005 
00006 using namespace std;
00007 
00008 typedef struct question {
00009     string answer;
00010     //Do you need a specific type to show the question and keep track of how they are shown? 
00011 } question_t;
00012 
00013 //Global variable
00014 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!";
00015 string read_questions = "";
00016 //Other?
00017 
00018 //Auxiliary functions
00019 string readline_questions(); //To read each question from the "questions" variable
00020 string readline_serial(); //To read a line from the serial channel
00021 void parse_line(string line, question_t *res); //To parse properly the question
00022 //Other?