120 Beacon St, Somerville, MA 02143
Move a Finger to a Stable Position

Welcome to programming the NeuroMaker Hand using C++ programming! In this project, we are going to investigate code that will enable us to move a finger to a stable position using the NeuroMaker Hand and the Arduino Editor.

 

Estimated Time

Approximately 1 hour

Number of People

1-4 students for each available NeuroMaker Hand

Necessary Supplies

  • One fully built NeuroMaker Hand
  • One MacOS, Windows or Chrome OS computer
  • Arduino Online Editor with Arduino Create Agent fully installed

Necessary Program Files

  • Please see the code breakdown in the below instructions

Preparations

  • Please ensure that the NeuroMaker Hand has working batteries. Additional power lights on the power board of the Hand should turn on when the on/off switch has been turn on. If your fingers move erratically or don’t move it all after uploading the below code this could mean that your batteries are running low.
  • Please ensure that the Arduino Create Agent and Arduino Online Editor are safe listed on your district firewall. Instructions for IT personnel is provided here: IP Addresses Safelist Guide
  • In case you have not yet installed the Arduino Editor, please complete the Set Up C++ Coding Environment Project

Background

Enabling a motor powered finger to move to and rest at a certain position is crucial for designers of assistive technology. Making a hello gesture, moving a hand to pick up a certain item or holding up a sign for someone else to see with all require us to designate a location for a finger to move to and then stop. This project will guide you on your first steps on making this come to life!

Project Instructions

Please follow the instructions in the following presentation walkthrough!

Move a Finger to a Stable Position Walkthrough

For your convenience, the code in this project has been provided below

/*
This program moves a finger and keeps it there to check if the program is uploaded successfully.
*/

//include the servo library to control the servo motors
#include <Servo.h>

//create 5 servos in an array
Servo servos[5];

//set up servo motors of fingers

void setup() {
  //servos 0, 1, 2, 3, and 4 move the thumb, index, middle, ring, and pinkie fingers respectively.
  servos[0].attach(6);
  servos[1].attach(5);
  servos[2].attach(4);
  servos[3].attach(3);
  servos[4].attach(2);
  
  //make sure the hand is in an open/default position
  openHand();
  delay(1000);
  
  //thumb goes down
  servos[0].write(180);
}

void openHand() {
  //fingers open up
  servos[0].write(0);
  servos[1].write(180);
  servos[2].write(0);
  servos[3].write(0);
  servos[4].write(180);
  return;
}

void loop() {
}

 

en_USEnglish