Skills Dev 4 - wting

Made by Wei-Ni Ting

Created: December 16th, 2020



The intention of this exercise is to create a material interaction with a motor, as well as to use the particle cloud to control the device. 



I used the servo to illustrate the idea of how fast the bus is approaching me. I pasted paper cut-outs showing a simple illustration of the bus figure and time. As the bus gets closer, the pointer will rotate to the designated degrees. By the time it arrives, the pointer will be at 180 degrees. I used the Particle cloud as a way to simulate data coming from an exterior source and tell the servo to rotate to the desired degrees. 

//Using a Servo

int servoPin = A3;
Servo myServo;
int servoPos = 0;

void setup() {
// Attach the servo on the A3 pin to the servo object
myServo.attach (A3);
// Register to particle cloud to control Servo from cloud
Particle.function ("servo", servoControl);
// Keep a cloud variable for the current position
Particle.variable ("servoPos", &servoPos, INT);


void loop() {


int servoControl(String command)
    // convert string command from Particle cloud to an integer 
    int newPos = command.toInt();
    // make sure it is in the right range 0-180
    // set the position
    servoPos = constrain( newPos, 0, 180);
    // set the Servo
    myServo.write( servoPos);
    // done
    return 1;

Click to Expand


Although the paper cutouts are very rough and can be refined more, I think it is a fun exercise by integrating the device with physical materials. I begin to see opportunities for incorporating IoT devices in the real world. It also allows me to look at ways of attaching materials onto the device in a presentable way (hiding wire, motor...etc).