Starting point for the exercise in the IoT workshop

Files at this revision

API Documentation at this revision

Comitter:
marcozecchini
Date:
Tue Feb 26 19:07:40 2019 +0000
Child:
1:d61cfd0e12a2
Commit message:
Starting point

Changed in this revision

START_FROM_HERE.txt Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/START_FROM_HERE.txt	Tue Feb 26 19:07:40 2019 +0000
@@ -0,0 +1,6 @@
+You first need to import the mbed-os library to start coding! To do so:
+1. Click on "Import"
+2. In the upper part of the new view click on: "Click here" to import from url
+3. Compile like this: "Source URL": https://github.com/ARMmbed/mbed-os/, "Import as": Library, "Import name": mbed-os, 
+                      "Target Path": Exercise_workshop (or the name of your project)
+4. 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Feb 26 19:07:40 2019 +0000
@@ -0,0 +1,22 @@
+#include "main.h"
+/*
+ * Auxiliary functions
+ */
+ 
+string readline_questions(){
+    size_t pos = questions.find("!"); 
+    string buffer = questions.substr(0, pos);
+    read_questions += buffer;
+    questions = questions.substr(pos+1);
+    
+    return buffer.substr(0, buffer.length()-1);
+}
+
+/*
+ * Main function
+ */
+
+int main()
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.h	Tue Feb 26 19:07:40 2019 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include <stdlib.h>
+#include <string>
+#define TURN 5
+
+using namespace std;
+
+typedef struct question {
+    string answer;
+    //Do you need a specific type to show the question and keep track of how they are shown? 
+} question_t;
+
+//Global variable
+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!";
+string read_questions = "";
+//Other?
+
+//Auxiliary functions
+string readline_questions(); //To read each question from the "questions" variable
+string readline_serial(); //To read a line from the serial channel
+void parse_line(string line, question_t *res); //To parse properly the question
+//Other?
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue Feb 26 19:07:40 2019 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#51d55508e8400b60af467005646c4e2164738d48