From ecfa92d5c492e1bd00b07b8e91582dc4cb152e76 Mon Sep 17 00:00:00 2001 From: Alexander Richter Date: Tue, 12 Sep 2023 22:57:52 +0200 Subject: [PATCH] Bugfixes --- LinuxCNC_ArduinoConnector.ino | 12 ++++++------ arduino-connector.py | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/LinuxCNC_ArduinoConnector.ino b/LinuxCNC_ArduinoConnector.ino index 69f7343..1702203 100644 --- a/LinuxCNC_ArduinoConnector.ino +++ b/LinuxCNC_ArduinoConnector.ino @@ -133,7 +133,7 @@ Note that Analog Pin numbering is different to the Print on the PCB. //#define QUADENC //Support for Quadrature Encoders. Define Pins for A and B Signals for your encoders. Visit https://www.pjrc.com/teensy/td_libs_Encoder.html for further explanation. - +// Download Zip from here: https://github.com/PaulStoffregen/Encoder and import as Library to your Arduino IDE. #ifdef QUADENC #include #define QUADENCS 2 //how many Rotary Encoders do you want? @@ -319,19 +319,19 @@ const int debounceDelay = 50; #ifdef KEYPAD byte KeyState = 0; #endif -#if QUADENC == 1 +#if QUADENCS == 1 const int QuadEncs = 1; #endif -#if QUADENC == 2 +#if QUADENCS == 2 const int QuadEncs = 2; #endif -#if QUADENC == 3 +#if QUADENCS == 3 const int QuadEncs = 3; #endif -#if QUADENC == 4 +#if QUADENCS == 4 const int QuadEncs = 4; #endif -#if QUADENC == 5 +#if QUADENCS == 5 const int QuadEncs = 5; #endif #ifdef QUADENC diff --git a/arduino-connector.py b/arduino-connector.py index e381e8c..f3fc3aa 100644 --- a/arduino-connector.py +++ b/arduino-connector.py @@ -75,16 +75,17 @@ AInputs = 0 #number of AInputs, Set AInputs = 0 to disable AInPinmap = [1] #Potentiometer connected to Pin 1 (A0) + # Set how many Latching Analog Inputs you have programmed in Arduino and how many latches there are, you can set as many as your Arduino has Analog pins. List the connected pins below. -SetLPotiValue = [1,2] #0 OFF - creates Pin for each Position - #1 S32 - Whole Number between -2147483648 to 2147483647 - #2 FLOAT - 32 bit floating point value +LPoti = 0 #number of LPotis, Set LPoti = 0 to disable LPotiLatches = [[1,9], #Poti is connected to Pin 1 (A1) and has 9 positions [2,4]] #Poti is connected to Pin 2 (A2) and has 4 positions -#Do you want the Latching Potis to control override Settings in LinuxCNC? This function lets you define values for each Position. -SetLPotiValue = [0,0] #0 = disable 1= enable +SetLPotiValue = [1,2] #0 OFF - creates Pin for each Position + #1 S32 - Whole Number between -2147483648 to 2147483647 + #2 FLOAT - 32 bit floating point value + LPotiValues = [[40, 50,60,70,80,90,100,110,120], [0.001,0.01,0.1,1]] @@ -402,7 +403,7 @@ while True: c["binselknob.{}".format(port)] = 0 if(Debug):print("binselknob.{}:{}".format(port,0)) else: - c["binselknob.{}.{}" .format(0,"out")] = BinSelKnobvalues[value] + c["binselknob.{}.{}" .format(0,"out")] = BinSelKnobvalues[0][value] elif cmd == "M": firstcom = 1