@@ -25,10 +25,6 @@ Finger::Finger()
2525{
2626 if (fingerIndex >= MAX_FINGERS ) // if too many fingers have been initialised
2727 {
28- MYSERIAL .print (" ERROR - Too many fingers attached (" );
29- MYSERIAL .print (fingerIndex);
30- MYSERIAL .println (" )" );
31-
3228 fingerIndex = -1 ; // set current finger number to be empty
3329 _isActive = false ; // set current finger as inactive
3430 }
@@ -133,7 +129,7 @@ uint8_t Finger::attach(uint8_t dir0, uint8_t dir1, uint8_t posSns, uint8_t force
133129 }
134130 else // if the current finger number isn't valid
135131 {
136- MYSERIAL .println (" ERROR - Too many fingers attached" );
132+ // MYSERIAL.println("ERROR - Too many fingers attached");
137133 _isActive = false ; // set the current finger to be inactive
138134 return (uint8_t )(-1 ); // return BLANK
139135 }
@@ -471,140 +467,140 @@ void Finger::disableForceSense(void)
471467
472468// PRINT
473469
474- // print the current position (no new line)
475- void Finger::printPos (void )
476- {
477- printPos (0 );
478- }
479-
480- // print the current position (new line)
481- void Finger::printPos (bool newL)
482- {
483- MYSERIAL .print (" Pos " );
484- MYSERIAL .print (readPos ());
485- MYSERIAL .print (" " );
486- if (newL)
487- MYSERIAL .print (" \n " );
488- }
489-
490- // print the current position error (no new line)
491- void Finger::printPosError (void )
492- {
493- printPosError (0 );
494- }
495-
496- // print the current position error (new line)
497- void Finger::printPosError (bool newL)
498- {
499- MYSERIAL .print (" Err " );
500- MYSERIAL .print (readPosError ());
501- MYSERIAL .print (" " );
502- if (newL)
503- MYSERIAL .print (" \n " );
504- }
505-
506- // print the current direction (no new line)
507- void Finger::printDir (void )
508- {
509- printDir (0 );
510- }
511-
512- // print the current direction (new line)
513- void Finger::printDir (bool newL)
514- {
515- const char * _dirString[2 ] = { " OPEN" ," CLOSE" }; // direction string
516-
517- MYSERIAL .print (" Dir " );
518- MYSERIAL .print (_dirString[readDir ()]);
519- MYSERIAL .print (" " );
520- if (newL)
521- MYSERIAL .print (" \n " );
522- }
523-
524- // print whether the target position has been reached (no new line)
525- void Finger::printReached (void )
526- {
527- printReached (0 );
528- }
529-
530- // print whether the target position has been reached (new line)
531- void Finger::printReached (bool newL)
532- {
533- MYSERIAL .print (" Reached " );
534- MYSERIAL .print (reachedPos ());
535- MYSERIAL .print (" " );
536- if (newL)
537- MYSERIAL .print (" \n " );
538- }
539-
540- // print the current speed (no new line)
541- void Finger::printSpeed (void )
542- {
543- printSpeed (0 );
544- }
545-
546- // print the current speed (new line)
547- void Finger::printSpeed (bool newL)
548- {
549- MYSERIAL .print (" Speed " );
550- MYSERIAL .print (readSpeed ());
551- MYSERIAL .print (" " );
552- if (newL)
553- MYSERIAL .print (" \n " );
554- }
555-
556- // print current position, direction, speed and whether the target position has been reached
557- void Finger::printDetails (void )
558- {
559- MYSERIAL .print (" Finger " );
560- MYSERIAL .print (fingerIndex);
561- MYSERIAL .print (" " );
562- printPos ();
563- printDir ();
564- printSpeed ();
565- printReached (true ); // print new line after
566-
567- }
568-
569- // print finger number, pins and limits
570- void Finger::printConfig (void )
571- {
572- MYSERIAL .print (" Finger" );
573- MYSERIAL .print (fingerIndex);
574- MYSERIAL .print (" -" );
575- MYSERIAL .print (" \t dir0: " );
576- MYSERIAL .print (_pin.dir [0 ]);
577- MYSERIAL .print (" \t dir1: " );
578- MYSERIAL .print (_pin.dir [1 ]);
579- MYSERIAL .print (" \t posSense: " );
580- MYSERIAL .print (_pin.posSns );
581- #ifdef FORCE_SENSE
582- MYSERIAL .print (" \t forceSense: " );
583- MYSERIAL .print (_pin.forceSns );
584- #endif
585- MYSERIAL .print (" \t invert: " );
586- MYSERIAL .println (_invert);
587-
588- MYSERIAL .print (" MinPos: " );
589- MYSERIAL .print (_pos.limit .min );
590- MYSERIAL .print (" \t MaxPos: " );
591- MYSERIAL .println (_pos.limit .max );
592-
593- MYSERIAL .print (" MinSpeed: " );
594- MYSERIAL .print (_speed.limit .min );
595- MYSERIAL .print (" \t MaxSpeed: " );
596- MYSERIAL .println (_speed.limit .max );
597-
598- #ifdef FORCE_SENSE
599- MYSERIAL .print (" MinForce: " );
600- MYSERIAL .print (_force.limit .min );
601- MYSERIAL .print (" \t MaxForce: " );
602- MYSERIAL .println (_force.limit .max );
603- #endif
604-
605-
606- MYSERIAL .print (" \n " );
607- }
470+ // // print the current position (no new line)
471+ // void Finger::printPos(void)
472+ // {
473+ // printPos(0);
474+ // }
475+ //
476+ // // print the current position (new line)
477+ // void Finger::printPos(bool newL)
478+ // {
479+ // MYSERIAL.print("Pos ");
480+ // MYSERIAL.print(readPos());
481+ // MYSERIAL.print(" ");
482+ // if (newL)
483+ // MYSERIAL.print("\n");
484+ // }
485+ //
486+ // // print the current position error (no new line)
487+ // void Finger::printPosError(void)
488+ // {
489+ // printPosError(0);
490+ // }
491+ //
492+ // // print the current position error (new line)
493+ // void Finger::printPosError(bool newL)
494+ // {
495+ // MYSERIAL.print("Err ");
496+ // MYSERIAL.print(readPosError());
497+ // MYSERIAL.print(" ");
498+ // if (newL)
499+ // MYSERIAL.print("\n");
500+ // }
501+ //
502+ // // print the current direction (no new line)
503+ // void Finger::printDir(void)
504+ // {
505+ // printDir(0);
506+ // }
507+ //
508+ // // print the current direction (new line)
509+ // void Finger::printDir(bool newL)
510+ // {
511+ // const char* _dirString[2] = { "OPEN","CLOSE" }; // direction string
512+ //
513+ // MYSERIAL.print("Dir ");
514+ // MYSERIAL.print(_dirString[readDir()]);
515+ // MYSERIAL.print(" ");
516+ // if (newL)
517+ // MYSERIAL.print("\n");
518+ // }
519+ //
520+ // // print whether the target position has been reached (no new line)
521+ // void Finger::printReached(void)
522+ // {
523+ // printReached(0);
524+ // }
525+ //
526+ // // print whether the target position has been reached (new line)
527+ // void Finger::printReached(bool newL)
528+ // {
529+ // MYSERIAL.print("Reached ");
530+ // MYSERIAL.print(reachedPos());
531+ // MYSERIAL.print(" ");
532+ // if (newL)
533+ // MYSERIAL.print("\n");
534+ // }
535+ //
536+ // // print the current speed (no new line)
537+ // void Finger::printSpeed(void)
538+ // {
539+ // printSpeed(0);
540+ // }
541+ //
542+ // // print the current speed (new line)
543+ // void Finger::printSpeed(bool newL)
544+ // {
545+ // MYSERIAL.print("Speed ");
546+ // MYSERIAL.print(readSpeed());
547+ // MYSERIAL.print(" ");
548+ // if (newL)
549+ // MYSERIAL.print("\n");
550+ // }
551+ //
552+ // // print current position, direction, speed and whether the target position has been reached
553+ // void Finger::printDetails(void)
554+ // {
555+ // MYSERIAL.print("Finger ");
556+ // MYSERIAL.print(fingerIndex);
557+ // MYSERIAL.print(" ");
558+ // printPos();
559+ // printDir();
560+ // printSpeed();
561+ // printReached(true); // print new line after
562+ //
563+ // }
564+ //
565+ // // print finger number, pins and limits
566+ // void Finger::printConfig(void)
567+ // {
568+ // MYSERIAL.print("Finger");
569+ // MYSERIAL.print(fingerIndex);
570+ // MYSERIAL.print(" -");
571+ // MYSERIAL.print(" \tdir0: ");
572+ // MYSERIAL.print(_pin.dir[0]);
573+ // MYSERIAL.print(" \tdir1: ");
574+ // MYSERIAL.print(_pin.dir[1]);
575+ // MYSERIAL.print(" \tposSense: ");
576+ // MYSERIAL.print(_pin.posSns);
577+ // #ifdef FORCE_SENSE
578+ // MYSERIAL.print(" \tforceSense: ");
579+ // MYSERIAL.print(_pin.forceSns);
580+ // #endif
581+ // MYSERIAL.print("\tinvert: ");
582+ // MYSERIAL.println(_invert);
583+ //
584+ // MYSERIAL.print("MinPos: ");
585+ // MYSERIAL.print(_pos.limit.min);
586+ // MYSERIAL.print("\tMaxPos: ");
587+ // MYSERIAL.println(_pos.limit.max);
588+ //
589+ // MYSERIAL.print("MinSpeed: ");
590+ // MYSERIAL.print(_speed.limit.min);
591+ // MYSERIAL.print("\tMaxSpeed: ");
592+ // MYSERIAL.println(_speed.limit.max);
593+ //
594+ // #ifdef FORCE_SENSE
595+ // MYSERIAL.print("MinForce: ");
596+ // MYSERIAL.print(_force.limit.min);
597+ // MYSERIAL.print("\tMaxForce: ");
598+ // MYSERIAL.println(_force.limit.max);
599+ // #endif
600+ //
601+ //
602+ // MYSERIAL.print("\n");
603+ // }
608604
609605
610606//
@@ -789,10 +785,6 @@ void Finger::forceController(void)
789785 // if force limit is reached
790786 if (_force.curr > _force.limit .max )
791787 {
792- MYSERIAL .print (" F" );
793- MYSERIAL .print (fingerIndex);
794- MYSERIAL .println (" max force" );
795-
796788 // store current movement direction so that stopping the motor is not perceived as a direction change
797789 bool tempDir = _dir.curr ;
798790
0 commit comments