Update HX-Joystick.ino
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: HX-Joystick.ino
|
||||
// AUTHOR: Didier Aeschimann
|
||||
// PURPOSE: HandBrake Joystick
|
||||
// PURPOSE: HandBrake Joystick for RallyBlock
|
||||
// URL: https://git.home.daprogs.net/DAProgs/handbrake_joystick/
|
||||
|
||||
|
||||
@@ -19,9 +19,17 @@ HX711 scale;
|
||||
|
||||
String readString, servo1, servo2;
|
||||
|
||||
// adjust pins if needed
|
||||
// Pins for HX711
|
||||
uint8_t dataPin = 6;
|
||||
uint8_t clockPin = 7;
|
||||
|
||||
bool showConfig;
|
||||
bool showValue;
|
||||
bool showDebug;
|
||||
|
||||
long loadCell;
|
||||
long MinVal=0;
|
||||
long MaxVal=0;
|
||||
long brake_;
|
||||
long conf_minValue=0;
|
||||
long conf_maxValue=13000;
|
||||
@@ -35,13 +43,6 @@ void setup()
|
||||
scale.tare();
|
||||
}
|
||||
|
||||
bool showConfig;
|
||||
bool showValue;
|
||||
bool showDebug;
|
||||
|
||||
long loadCell;
|
||||
long MinVal=0;
|
||||
long MaxVal=0;
|
||||
|
||||
void loop()
|
||||
{
|
||||
@@ -61,10 +62,6 @@ void loop()
|
||||
if(loadCell > conf_minValue)
|
||||
brake_ = map(loadCell, conf_minValue, (conf_maxValue+1), 0, 1024);
|
||||
|
||||
// long test;
|
||||
// test = map(21320,0,21321,0,1023);
|
||||
// Serial.println(test);
|
||||
|
||||
#ifdef BrakeMode
|
||||
Joystick.setBrake(brake_);
|
||||
#else
|
||||
@@ -102,7 +99,7 @@ void loop()
|
||||
|
||||
if (showConfig) {
|
||||
showConfig = false;
|
||||
Serial.println("DAProgs Handbrake Joystick. v1.0");
|
||||
Serial.println("DAProgs Handbrake Joystick. v1.01");
|
||||
Serial.println("Configs:");
|
||||
Serial.print(" minVal=");
|
||||
Serial.println(MinVal);
|
||||
@@ -119,12 +116,10 @@ void loop()
|
||||
#else
|
||||
Serial.println(" mode=axis");
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Serial.println("");
|
||||
}
|
||||
|
||||
/*
|
||||
if (readString.length() >0) {
|
||||
Serial.println(readString); //see what was received
|
||||
|
||||
@@ -140,8 +135,7 @@ void loop()
|
||||
|
||||
readString="";
|
||||
}
|
||||
|
||||
*/
|
||||
delay(2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user