An experiment on connecting two remote interactive installations through Particle.io platform and wifi.
Process

Prototype
One Side
The other side
Technical Details
STEP1: TEST THE SENSOR:CONNECT THE CIRCUIT AND TEST SENSORS WITH EXAMPLE CODE
I used the RGB LED Module to control the color and indensity of light and Six-axis Inertial Motion sensor to detect the movement.

STEP2: MAKE THE LIGHTNING CREATURE
I put the sensors, the expression organs in the body of the creature, and the breadboard, and its brain – my Photon board outside.


STEP3: PROGRAM BASED ON IDEA: MAKE CONNECTION
Response to the signal from the other side, when the heat is gone, the light intensity decreases, and finally the creature runs out of energy.
void setup()
{Particle.subscribe("temperature", myHandler);}
void myHandler(const char *event, const char *data) {
int remote_brightness = atoi(data);
// Zhuoyu's sensor from 3000-2000, map my RGB brightness from the brightest to the darkest
if (remote_brightness < 1750 ){
RGB_Strip.setBrightness(0);
} else if (remote_brightness > 3250 ){
RGB_Strip.setBrightness(255);
}else
{remote_brightness = map ( remote_brightness, 3250, 1750, 255, 0 );
RGB_Strip.setBrightness(remote_brightness);}
}

The creature struggles, when it moves suddenly, the color changes.
void startShow(int n) {
switch(n){
case 0: colorWipe(RGB_Strip.Color(255, 0, 0), 50); // Red
break;
case 1: colorWipe(RGB_Strip.Color(0, 255, 0), 50); // Green
break;
case 2: colorWipe(RGB_Strip.Color(0, 0, 255), 50); // Blue
break;
case 3: colorWipe(RGB_Strip.Color(RED_VAL_1, GREEN_VAL_1, BLUE_VAL_1), 50); //Custom colour1: Yellow
break;
case 4: colorWipe(RGB_Strip.Color(RED_VAL_2, GREEN_VAL_2, BLUE_VAL_2), 50); //Custom colour2: Purple
break;
case 5: colorWipe(RGB_Strip.Color(RED_VAL_3, GREEN_VAL_3, BLUE_VAL_3), 50); //Custom colour3: Cyan
break; }
}
void loop() {
Particle.publish("Gyro_X_by_Fuyao", String::format("%.1f", GyroX)); }
Then, get the real-time data of my creature from API
void loop() {
Particle.publish("Gyro_X_by_Fuyao", String::format("%.1f", GyroX)); }
void loop() {
float GyroX = accelGyro[3] / 180.0;
StringGyroX = String(GyroX)}

