My Spindle Motor Coolant Controller Project is moving on at reasonable pace and on of the next part of the project involves including a Rotary Encoder to increment and decrement a temperature range and a Fan Speed PWM service.
The Rotary Encoder I have is working which increments and decrements a numeric value from 0 to 1000 and is quite stable but what I want it to do is increment/decrement in decimal value like 30.5 , 30.6 etc.
It's basic maths again, but heck I haven't used this stuff in absolute eons, I have fumbled on nearly all day trying to work it out to where my head hurts!
. I know there are some really clever lads out there who do this as a breakfast crossword.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Still on the same tack so to speak but with a different approach. Is it possible in GCB to take the last digit of a numeric value of say 648 to display the last digit '8' using something like
'Print Right(value, 1) or do I have to convert the numeric value into a string?
Running 'Print Right(value, 1)' spews out a boatload of symbols and characters from what looks like the LCD Character Set 8>(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My Spindle Motor Coolant Controller Project is moving on at reasonable pace and on of the next part of the project involves including a Rotary Encoder to increment and decrement a temperature range and a Fan Speed PWM service.
The Rotary Encoder I have is working which increments and decrements a numeric value from 0 to 1000 and is quite stable but what I want it to do is increment/decrement in decimal value like 30.5 , 30.6 etc.
It's basic maths again, but heck I haven't used this stuff in absolute eons, I have fumbled on nearly all day trying to work it out to where my head hurts!
. I know there are some really clever lads out there who do this as a breakfast crossword.
What range does it need to be?
And, we can assume 1 decimal point.
What will be happening with the value? display on lcd? send via serial to terminal?
Need to know the range before being able to help.
I'll put this on the back burner for the time being Evan.
Still on the same tack so to speak but with a different approach. Is it possible in GCB to take the last digit of a numeric value of say 648 to display the last digit '8' using something like
'Print Right(value, 1) or do I have to convert the numeric value into a string?
Running 'Print Right(value, 1)' spews out a boatload of symbols and characters from what looks like the LCD Character Set 8>(
If 'value' is a number type.
'value MOD 10'. See mod() in the Help.
It is saying "Your search returned no results." for either MOD 10 or mod() ??
The Help search is modulo. Where
%
is the same asMOD
.The following program will display the last digit.
The modulo operation returns the remainder or signed remainder of a division, after one number is divided by another.
Enjoy
Edit: Fixed baud rate
Last edit: William Roth 2023-02-07