Changing your face
The current task of our mission is to integrate the prototyped hardware controller we have just created into the Smilie-O-Mat controller. We will extend the program to parse the messages that our Arduino-based controller is sending via the serial port and adjust the sliders to match the values of the hardware knobs. When the user of our controller presses the button on the board, we are going to call the tweet()
method.
Engage Thrusters
Let's change our smiley using our controller:
Open the Smilie-O-Mat sketch from our previous mission.
To get access to the serial port, we need to import the
serial
library, so use the Sketch | Import library … | serial menu to import it.Now add a
Serial
object to your sketch:import twitter4j.*; import processing.serial.*; Serial port; Twitter twitter; String[] tweets = { "I feel like so #SmilieOMat", "I currently feel like this #SmilieOMat", "This is how I feel #SmilieOMat" }; ...
In the
setup()
method, we need to initialize the serial...