diff --git a/report/src/report.tex b/report/src/report.tex index 29b5afeb8c22e5e94eee391859090da706392160..81c09618cae0ba208a8ed62a99175c4279470a8e 100644 --- a/report/src/report.tex +++ b/report/src/report.tex @@ -34,7 +34,7 @@ On the right side of the same breadboard are the four temperature sensors (three in light blue and one in black) attached. Underneath them, two LEDs representing the pumps (for testing purposes), and one button, are put on. Parts of the LCD can be seen on the right top corner. - On the lower breadboard is the mp3 module installed. + On the lower breadboard is the MP3 module installed. In the final circuit the LEDs are replaced with relays for the pumps.} \label{fig:proto1} \end{figure} @@ -88,31 +88,31 @@ If the display is currently turned on and the this timestamp is more than 30 sec \section{MP3} \label{sec:mp3} -All the sounds we are playing over the speaker are pregenerated mp3-files. +All the sounds we are playing over the speaker are pre-generated MP3-files. We used a text-to-speech program, available at \url{https://www.text-speech.net}, which had the best sounding artificial voice in our opinion. The website only plays the sound file, and therefore another program was needed to record it. In our case, the free and open source program \textit{Audacity} was used. During the recording session, the sounds were cut in matching time length via visual judgement. These sound files are then loaded onto the SD card. -The mp3 player plays a file, if the matching integer, which represents the storage position on the SD card, is sent. +The MP3 player plays a file, if the matching integer, which represents the storage position on the SD card, is sent. In \textit{soundFiles.h} macros are defined, to easily assign the sound file to its position integer. -The whole sound extraction process could be improved by using a dedicated text to speech program which creates mp3 files, because in our case unnecessary silence after the cutting process still remained. +The whole sound extraction process could be improved by using a dedicated text to speech program which creates MP3 files, because in our case unnecessary silence after the cutting process still remained. Another challenge was to not halt the main loop when we want to say something. For example if we want to say the ``twenty five'' we would love to simply call the functions as \\ play(twenty); play(five); \\ -But unfortunately the mp3 module we used does not have a queue functionality so what would actually happen is that the first few milliseconds of the ``twenty'' are getting played, but then it gets stopped and instead ``five'' is being played. +But unfortunately the MP3 module we used does not have a queue functionality so what would actually happen is that the first few milliseconds of the ``twenty'' are getting played, but then it gets stopped and instead ``five'' is being played. For this reason we needed to implement our own queue. We simply have a global list of integers (by default all of them are zero), a global variable that saves the current playing index, and a global variable that saves the current end index of the queue. We then one function that gets called on every loop. -It checks whether the mp3 module is still busy. +It checks whether the MP3 module is still busy. If it is not any more, it looks if there is a file to play at the current playing index. If there is (indicated by a non-zero entry), then we start playing that file, and increment the current playing index. We have another function for adding files to the queue. It simply puts the number of the file to play at the current end index of the queue, and increments the queue. -Both index variables get set back to zero in case they reach the the end of the queue. +Both index variables get set back to zero in case they reach the end of the queue. \section{Saying Numbers} As our ``client'' only speaks German, we needed to implement the way numbers are read in that language. @@ -172,8 +172,8 @@ as we want to say ``zweihundert'' for \(n=200\) and not ``zweihundertnull''. \EndFunction \end{algorithmic} \end{algorithm} -Finally our main function sayNumber(\(n\)) goes thorugh all the possible cases. -A peudocode implementation of it can be seen in \autoref{alg:saynumber}. +Finally our main function sayNumber(\(n\)) goes through all the possible cases. +A pseudocode implementation of it can be seen in \autoref{alg:saynumber}. \section{Temperature} For our prototype, we use different temperature sensors, which need different libraries. For this reason, we wrote four different functions for each temperature sensor, which work on the same principles. @@ -181,7 +181,7 @@ The function will return the state, an enum defined by us, in which the sensor i We use static variables to handle the time related queries. At the beginning we check whether the update time has been passed. If it didn't, the unchanged state gets returned and nothing happens. -In the other case, the problem goes on and the temperature from the sensor gets read out. +In the other case, the program goes on and the temperature from the sensor gets read out. After this, we check if some error occurred and the resulting temperature is faulty. We differentiate between two cases, the short term error and long term error. The long term error gets returned if the error occurred continuously for at least 60 seconds.