dArtofScience
Published © CC BY-NC-ND

Smart Fingers

Smart Fingers is a set of remotely controlled fingers linked to Cayenne. Control anything from anywhere.

IntermediateShowcase (no instructions)1,179
Smart Fingers

Things used in this project

Hardware components

Wemos D1 Mini
Espressif Wemos D1 Mini
×1
Servos (Tower Pro MG996R)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Cayenne
myDevices Cayenne

Story

Read more

Schematics

circuit

Code

arduino code

Arduino
#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
#define SERVO_VIRTUAL_PIN 1
#define SERVO_DIGITAL_PIN 4
#include <Servo.h>
Servo s1;
double lastPosition = 0;
// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "autothentication token";
// Your network name and password.
char ssid[] = "name";
char password[] = "password";
void setup() {
pinMode(0, OUTPUT);
s1.attach(SERVO_DIGITAL_PIN);
  Serial.begin(9600);
  Cayenne.begin(token, ssid, password);
}
CAYENNE_IN(SERVO_VIRTUAL_PIN)
{
  // get value sent from dashboard
  double currentValue = getValue.asDouble();
  int position = currentValue * 200;
  // actually move the servo to the specified position
  s1.write(position);

  //update last position
  lastPosition = currentValue;
}



void loop() {
  
  Cayenne.run();
}

Credits

dArtofScience

dArtofScience

1 project • 0 followers

Comments