From 661fc09eaa1c1d4657a784b23d828c06355f8018 Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Wed, 7 Apr 2010 13:26:47 -0400
Subject: [PATCH 1/2] small rewrite of the sphere example with
 a few changes in the behavior that make
 it more easy to use.

---
 examples/falcon_test_cli/FalconSphereTest.cpp |   30 +++++++++++++++++-------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/examples/falcon_test_cli/FalconSphereTest.cpp b/examples/falcon_test_cli/FalconSphereTest.cpp
index 6312558..9c62c74 100644
--- a/examples/falcon_test_cli/FalconSphereTest.cpp
+++ b/examples/falcon_test_cli/FalconSphereTest.cpp
@@ -75,23 +75,35 @@ void FalconSphereTest::runFunction()
 		return;
 	}
 
-	// make sphere soft radius
 	if(m_falconDevice->getFalconGrip()->getDigitalInputs() 
-	   & libnifalcon::FalconGripFourButton::BUTTON_3)
+	   & libnifalcon::FalconGripFourButton::BUTTON_2)
 	{
-		m_stiffness = 100.0;
+		m_forwardButtonDown = true;
 	} else{
-		m_stiffness = 1000.0;
+		m_forwardButtonDown = false;
 	}
 
-
-	// make sphere soft sticky
+	// make sphere soft radius or "slippery"
 	if(m_falconDevice->getFalconGrip()->getDigitalInputs() 
-	   & libnifalcon::FalconGripFourButton::BUTTON_2)
+	   & libnifalcon::FalconGripFourButton::BUTTON_3)
 	{
-		m_forwardButtonDown = true;
+		if(m_forwardButtonDown)
+		{
+			m_stiffness = -300.0;
+                } 
+                else 
+                {
+			m_stiffness = 1000.0;
+                }
 	} else{
-		m_forwardButtonDown = false;
+                if(m_forwardButtonDown)
+                {
+			m_stiffness = 500.0;
+		} 
+		else 
+		{
+			m_stiffness = 100.0;
+		}
 	}
 
 
-- 
1.6.6.1

