Ski dev 4

Made by ziyuh

Created: December 4th, 2021

0

Exercise

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

void setup() {

  // attaches the servo on the A3 pin to the servo object
  myServo.attach( A2 );

   //Register our Particle to control the servo
  Particle.function("servo", servoControl);

  // Keep a cloud variable for the current position
  Particle.variable(  "servoPos" , &servoPos , INT );


}

int servoControl(String command)
{
   int newPos = command.toInt();
   servoPos = constrain( newPos, 0 , 170);

   myServo.write( servoPos );

   return 1;
}
Click to Expand
0

Weather Pointer

0
int servoPin = D4;
Servo myServo;
int servoPos = 49;

void setup() {

  // attaches the servo on the A3 pin to the servo object
  myServo.attach( D4 );

   //Register our Particle to control the servo
  Particle.function("servo", servoControl);

  // Keep a cloud variable for the current position
  Particle.variable(  "servoPos" , &servoPos , INT );


}

int servoControl(String command)
{
   int newPos = command.toInt();
   servoPos = constrain( newPos, 0 , 170);

   myServo.write( servoPos );

   return 1;
}
Click to Expand
0
Ski dev
Ziyu Han - https://youtu.be/_orfqdL-aUw
0

Process: By accomplishing the motor training, I find it interesting to simply make a move and give meaning to the motion. It can be widely used in data visualization, responsive things. And combining the IFTTT with the motor should be very interesting which I would have a try while having time.

0

Reflection: should add the IFTTT function to this demo.

x