113
edits
Cesardaher (talk | contribs) |
Cesardaher (talk | contribs) No edit summary |
||
Line 38: | Line 38: | ||
[[File:TCLM_reference_3.jpg|400px]] | [[File:TCLM_reference_3.jpg|400px]] | ||
== | ==Development== | ||
The first attempts were to connect the ESP8266 to the internet and use it to access the Twitter API to retrieve tweets without issuing any additional commands. The Twitter API library for Arduino comes with three basic functions: | |||
*Search for a keyword | |||
<code>std::string search_str; | |||
String tmsg = tcr.searchTwitter(search_str);</code> | |||
*Retrieve user information | |||
<code>std::string search_str; | |||
tcr.searchUser(search_str);</code> | |||
*Post to Twitter | |||
<code>std::string twitter_post_msg; | |||
tcr.tweet(twitter_post_msg);</code> | |||
The first one was in the core of the project, while the second and third were only used for some early testing. In order to use the search feature, it is required to define a search string, which can be formatted to include complex parameters (explained in the [https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets Developer Twitter Documentation]). This function, however, does not support tweet collection or analysis. | |||
Once I understood how to properly use this library and had successful attempts, I moved on to develop a more complex mechanism. Inspired by the previously mentioned Twitch Plays Pokémon, I devised a device which would collect tweets with any one of the directional words "up", "down", "left" and "right" (excluding retweets, in order to prevent duplicates) and use them as commands for the microcontroller. The interesting thing about these words is that they are extensively used in the English language with other conotations, which makes the search especially random. | |||
<code>std::string search_str = "up OR down OR left OR right -RT";</code> | |||
These commands were devised to navigate a 3x3 LED matrix in which the LEDs were stored in the code as a 2D array. That way, they were able to be lit up by calling their indexes. | |||
[[File:LED_array.png]] | |||
=Development= | =Development= |
edits