This commit is contained in:
Alexander Richter 2023-09-12 22:57:52 +02:00
parent 95a35bb1c9
commit ecfa92d5c4
2 changed files with 13 additions and 12 deletions

View File

@ -133,7 +133,7 @@ Note that Analog Pin numbering is different to the Print on the PCB.
//#define QUADENC //#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. //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 #ifdef QUADENC
#include <Encoder.h> #include <Encoder.h>
#define QUADENCS 2 //how many Rotary Encoders do you want? #define QUADENCS 2 //how many Rotary Encoders do you want?
@ -319,19 +319,19 @@ const int debounceDelay = 50;
#ifdef KEYPAD #ifdef KEYPAD
byte KeyState = 0; byte KeyState = 0;
#endif #endif
#if QUADENC == 1 #if QUADENCS == 1
const int QuadEncs = 1; const int QuadEncs = 1;
#endif #endif
#if QUADENC == 2 #if QUADENCS == 2
const int QuadEncs = 2; const int QuadEncs = 2;
#endif #endif
#if QUADENC == 3 #if QUADENCS == 3
const int QuadEncs = 3; const int QuadEncs = 3;
#endif #endif
#if QUADENC == 4 #if QUADENCS == 4
const int QuadEncs = 4; const int QuadEncs = 4;
#endif #endif
#if QUADENC == 5 #if QUADENCS == 5
const int QuadEncs = 5; const int QuadEncs = 5;
#endif #endif
#ifdef QUADENC #ifdef QUADENC

View File

@ -75,16 +75,17 @@ AInputs = 0 #number of AInputs, Set AInputs = 0 to disable
AInPinmap = [1] #Potentiometer connected to Pin 1 (A0) 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. # 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 LPoti = 0 #number of LPotis, Set LPoti = 0 to disable
#1 S32 - Whole Number between -2147483648 to 2147483647
#2 FLOAT - 32 bit floating point value
LPotiLatches = [[1,9], #Poti is connected to Pin 1 (A1) and has 9 positions 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 [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 = [1,2] #0 OFF - creates Pin for each Position
SetLPotiValue = [0,0] #0 = disable 1= enable #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], LPotiValues = [[40, 50,60,70,80,90,100,110,120],
[0.001,0.01,0.1,1]] [0.001,0.01,0.1,1]]
@ -402,7 +403,7 @@ while True:
c["binselknob.{}".format(port)] = 0 c["binselknob.{}".format(port)] = 0
if(Debug):print("binselknob.{}:{}".format(port,0)) if(Debug):print("binselknob.{}:{}".format(port,0))
else: else:
c["binselknob.{}.{}" .format(0,"out")] = BinSelKnobvalues[value] c["binselknob.{}.{}" .format(0,"out")] = BinSelKnobvalues[0][value]
elif cmd == "M": elif cmd == "M":
firstcom = 1 firstcom = 1