Hey fellow ubitx fans, has anyone had luck using a CNC encoder? I purchased one and get 4 pulses for every click of the dial. Not good! Thanks for any info! Barry
K3bo
|
There's a library that corrects for that (I forgot who wrote it, but a search should find it), or you can do it in code yourself. Basically, store the count in a static int and reset after 4 clicks instead of one.
Jack, W8TEE
On Wednesday, May 12, 2021, 3:46:49 PM EDT, barry halterman <kthreebo@...> wrote:
Hey fellow ubitx fans, has anyone had luck using a CNC encoder? I purchased one and get 4 pulses for every click of the dial. Not good! Thanks for any info! Barry
K3bo
-- Jack, W8TEE
|
#include <RotaryEncoder.h> /*Support for 100 PPR rotary encoder*/
/*/
/*? ? ? ? ? ? ? ? ? ? ? ? ?ROTARY ENCODER? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/
/*/
/*We are using an encoder with 100 PPR (Pulses Per Rotation)*/
#define RotaryEncoderPinB 10 /*Encoder pins? - Marked B- on body*/
#define RotaryEncoderPinA 11 /*Marked A- on body*/
#define EncoderRotatedCCW -1 /*Value returned for CCW rotation of encoder*/
/*Setup a RotaryEncoder with 4 steps per pulse for the 2 signal input pins*/
RotaryEncoder encoder(RotaryEncoderPinB, RotaryEncoderPinA, RotaryEncoder::LatchMode::FOUR3);
/*This interrupt routine will be called on any change of one of the input signals*/
static int pos = 0; /*If changed from last pass, encoder has been rotated*/
enum RotaryEncoderDirections /*Which way is the rotary encoder being rotated or not*/
{
? NoRotation, /*No rotation*/
? CwRotation, /*CW rotation*/
? CcwRotation /*CCW rotation*/
};
RotaryEncoderDirections CurrentRotaryEncoderDirection;
/*/
void EncoderInterruptService()
{
? encoder.tick(); /*Call tick() function to check the rotary encoder state*/
}//END EncoderInterruptService
?
/*/
RotaryEncoderDirections CheckEncoderStatus()
{
? encoder.tick(); /*Query the encoder library*/
? int newPos = encoder.getPosition(); /*Get current encoder position*/
? if (pos != newPos) /*Has encoder been rotated*/
? {
? ? if (int(encoder.getDirection()) == EncoderRotatedCCW) /*Query encoder library for rotation direction*/
? ? {
? ? ? pos = newPos; /*Save new rotary encoder position*/
? ? ? return CcwRotation; /*Encoder rotated CCW*/
? ? }
? ? else
? ? {
? ? ? pos = newPos; /*Save new rotary encoder position*/
? ? ? return CwRotation; /*Encoder rotated CW*/
? ? }
? }
? else
? {
? ? return NoRotation; /*ENccoder not rotated*/
? }
}//END CheckEncoderStatus
?
//
void setup()
{
? Serial.begin(9600);
? /*Setup rotary encoder interrupt routines for pin change*/
? attachInterrupt(digitalPinToInterrupt(RotaryEncoderPinB), EncoderInterruptService, CHANGE);
? attachInterrupt(digitalPinToInterrupt(RotaryEncoderPinA), EncoderInterruptService, CHANGE);
}//END setup
?
/*/
/*/
void loop()
{
CurrentRotaryEncoderDirection = CheckEncoderStatus();
? switch(CurrentRotaryEncoderDirection)
? {
? ? case CwRotation:
? ? ? {
? ? ? ?Serial.println("CW");
? ? ? ? ?break;
? ? ? }
? ? case CcwRotation:
? ? ? {
? ? ? ?Serial.println("CCW");
? ? ? ? ?break;
? ? ? }
? ? default:
? ? ? {
? ? ? ? ?break;
? ? ? }
? }
} //END loop
?
|
Dennis:
Why not make pos a static int within the CheckEncoderStatus()? It's still allocated on the heap, but you remove it from exposure via global scope and encapsulate it within the method that needs it. Also, if you decide to make it a library, you don't need to worry about its presence in a header file since it's buried within the method.
Jack, W8TEE
On Thursday, May 13, 2021, 8:24:53 AM EDT, Dennis Zabawa <kg4rul@...> wrote:
#include <RotaryEncoder.h> /*Support for 100 PPR rotary encoder*/
/*/
/*? ? ? ? ? ? ? ? ? ? ? ? ?ROTARY ENCODER? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*/
/*/
/*We are using an encoder with 100 PPR (Pulses Per Rotation)*/
#define RotaryEncoderPinB 10 /*Encoder pins? - Marked B- on body*/
#define RotaryEncoderPinA 11 /*Marked A- on body*/
#define EncoderRotatedCCW -1 /*Value returned for CCW rotation of encoder*/
/*Setup a RotaryEncoder with 4 steps per pulse for the 2 signal input pins*/
RotaryEncoder encoder(RotaryEncoderPinB, RotaryEncoderPinA, RotaryEncoder::LatchMode::FOUR3);
/*This interrupt routine will be called on any change of one of the input signals*/
static int pos = 0; /*If changed from last pass, encoder has been rotated*/
enum RotaryEncoderDirections /*Which way is the rotary encoder being rotated or not*/
{
? NoRotation, /*No rotation*/
? CwRotation, /*CW rotation*/
? CcwRotation /*CCW rotation*/
};
RotaryEncoderDirections CurrentRotaryEncoderDirection;
/*/
void EncoderInterruptService()
{
? encoder.tick(); /*Call tick() function to check the rotary encoder state*/
}//END EncoderInterruptService
?
/*/
RotaryEncoderDirections CheckEncoderStatus()
{
? encoder.tick(); /*Query the encoder library*/
? int newPos = encoder.getPosition(); /*Get current encoder position*/
? if (pos != newPos) /*Has encoder been rotated*/
? {
? ? if (int(encoder.getDirection()) == EncoderRotatedCCW) /*Query encoder library for rotation direction*/
? ? {
? ? ? pos = newPos; /*Save new rotary encoder position*/
? ? ? return CcwRotation; /*Encoder rotated CCW*/
? ? }
? ? else
? ? {
? ? ? pos = newPos; /*Save new rotary encoder position*/
? ? ? return CwRotation; /*Encoder rotated CW*/
? ? }
? }
? else
? {
? ? return NoRotation; /*ENccoder not rotated*/
? }
}//END CheckEncoderStatus
?
//
void setup()
{
? Serial.begin(9600);
? /*Setup rotary encoder interrupt routines for pin change*/
? attachInterrupt(digitalPinToInterrupt(RotaryEncoderPinB), EncoderInterruptService, CHANGE);
? attachInterrupt(digitalPinToInterrupt(RotaryEncoderPinA), EncoderInterruptService, CHANGE);
}//END setup
?
/*/
/*/
void loop()
{
CurrentRotaryEncoderDirection = CheckEncoderStatus();
? switch(CurrentRotaryEncoderDirection)
? {
? ? case CwRotation:
? ? ? {
? ? ? ?Serial.println("CW");
? ? ? ? ?break;
? ? ? }
? ? case CcwRotation:
? ? ? {
? ? ? ?Serial.println("CCW");
? ? ? ? ?break;
? ? ? }
? ? default:
? ? ? {
? ? ? ? ?break;
? ? ? }
? }
} //END loop
?
-- Jack, W8TEE
|
This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
|
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry
toggle quoted message
Show quoted text
On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
|
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman <kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry
toggle quoted message
Show quoted text
On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
|
Jack, your upcoming article was enough for me to go ahead subscribe to the digital edition of CQ.??
|
Thanks, Dennis...the pressure's on!! 
On Friday, May 14, 2021, 7:50:24 AM EDT, Dennis Zabawa <kg4rul@...> wrote:
Jack, your upcoming article was enough for me to go ahead subscribe to the digital edition of CQ.??
-- Jack, W8TEE
|
Jack
Of course I would be interested.? I might even be able to contribute some
problems and maybe some solutions for the column.
Things that immediately come to mind: - How to do a Screen Clear on the dumb terminal in an Arduino IDE.
- How to integrate commands from both push-buttons and a keyboard.
- BitLash, further development for Arduino.
- Using the Arduino dumb terminal with and without keystroke echoing.
- And several more things that have bugged me in my most recent projects.
Arv? K7HKL _-_
toggle quoted message
Show quoted text
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman < kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
|
Hi Arv:
All of those would be interesting, but I don't know anything about BitLash other than what it is. Usually, a device being used as a screen (e.g., 16x2 display or TFT color display) will have doc sheets telling what the commands are for a clear screen (and other things, like cursor positioning). Reading push buttons or a keyboard is really the same thing, only a keyboard usually has more switches that the microcontroller has pins, so some kind of interface is normally used. The current project I'm working on (an SDT) uses one pin to control 16 switches, saving me 15 pins for other uses. Those are the kinds of things I want to highlight.
I do have to keep in mind that I need to provide a solution in a fairly small number of paragraphs. Still, I think it would be nice to have a place where software topics can be discussed. If it does happen, I would also like to present the ideas/solutions of others, too.
Jack, W8TEE
On Friday, May 14, 2021, 4:30:42 PM EDT, Arv Evans <arvid.evans@...> wrote:
Jack
Of course I would be interested.? I might even be able to contribute some
problems and maybe some solutions for the column.
Things that immediately come to mind: - How to do a Screen Clear on the dumb terminal in an Arduino IDE.
- How to integrate commands from both push-buttons and a keyboard.
- BitLash, further development for Arduino.
- Using the Arduino dumb terminal with and without keystroke echoing.
- And several more things that have bugged me in my most recent projects.
Arv? K7HKL _-_
toggle quoted message
Show quoted text
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman < kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
-- Jack, W8TEE
|
Jack
At the risk of giving away some content that may have been better saved
for your column, I was talking about the pseudo dumb terminal that is part
of the Arduino IDE.? To the best of my knowledge there is no command that
be sent by the attached Arduino to clear this pseudo-terminal screen. My solution is to have the Arduino code send a series of "\n" commands
to the dumb terminal emulator.? At 9600 or above this happens so fast that
existing screen content is simply scrolled off the screen and disappears
without even a flicker.?
Code has been added to BitLash to allow it to poll and write to various ports in modes that provide ham radio type interfaces (i.e. SWR, PWR, REV, FWD,
MODE, FREQUENCY, FREQUENCY STEP SIZE, FREQUENCY STEP RATE, VFO-A, VFO-B, VFO-C, VFO-D, and so on).? BitLash can be rebuilt to be both
attached computer with, or without CAT controls for various type of CAT...even
the Schr?dinger's version!
?
As you know, many of those here have only recently started to teach
themselves C-language.? My typical mistakes may be of interest to them as they make similar mistakes and have related questions.? Others are
like me, old codgers with poor memories, and need all the help we can get.
Arv _._
toggle quoted message
Show quoted text
Hi Arv:
All of those would be interesting, but I don't know anything about BitLash other than what it is. Usually, a device being used as a screen (e.g., 16x2 display or TFT color display) will have doc sheets telling what the commands are for a clear screen (and other things, like cursor positioning). Reading push buttons or a keyboard is really the same thing, only a keyboard usually has more switches that the microcontroller has pins, so some kind of interface is normally used. The current project I'm working on (an SDT) uses one pin to control 16 switches, saving me 15 pins for other uses. Those are the kinds of things I want to highlight.
I do have to keep in mind that I need to provide a solution in a fairly small number of paragraphs. Still, I think it would be nice to have a place where software topics can be discussed. If it does happen, I would also like to present the ideas/solutions of others, too.
Jack, W8TEE
On Friday, May 14, 2021, 4:30:42 PM EDT, Arv Evans < arvid.evans@...> wrote:
Jack
Of course I would be interested.? I might even be able to contribute some
problems and maybe some solutions for the column.
Things that immediately come to mind: - How to do a Screen Clear on the dumb terminal in an Arduino IDE.
- How to integrate commands from both push-buttons and a keyboard.
- BitLash, further development for Arduino.
- Using the Arduino dumb terminal with and without keystroke echoing.
- And several more things that have bugged me in my most recent projects.
Arv? K7HKL _-_
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman < kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
-- Jack, W8TEE
|
Jack,
That would be very cool. But darn, I¡¯d have to subscribe to CQ. If they go for it let me know and I¡¯ll subscribe.
I¡¯ve been wondering about a better encoder. Something like 200 PPR so a dial rotation would come out at 2KHz at 10 Hz. I bought one on eBay but it is for industrial counting of things and not smooth enough for a VFO. So most def, I am interested in such a column.
And I like your topic immensely,
Joe N9JR
|
Joe:
There are a lot of optical encoders that can approach 200 ppr, but they're not cheap. I think I saw one on eBay for less that $30, but that was several weeks ago. Some go as high as several hundred dollars...probably way overkill for your needs. What is a "better encoder" to you? I'm working on an SDT and I have a $1.50 encoder in it and it's fine for me. However, I like detents as they prevent me from "coasting" past a desired frequency.
As to buying a subscription, truth be told, almost anything you see in print today can be slightly modified and then posted on the Net. My publisher once told me that for every book I sell, 5 are downloaded for free. The real cost is not what I lose, but the books that don't get written because it's just not worth it anymore. However, we really do need to support the magazines that interest us. Ham Radio, Electronics Illustrated, 73 Magazine, Radio News and others...gone. Give up a dinner out and buy a subscription to one that still exists: CQ, QST, QRPQ, Sprat, RadCom and others...any one of them is worth it.
Jack, W8TEE
On Friday, May 14, 2021, 6:34:29 PM EDT, jereed@... <jereed@...> wrote:
Jack,
That would be very cool.? But darn, I¡¯d have to subscribe to CQ.? If they go for it let me know and I¡¯ll subscribe.
I¡¯ve been wondering about a better encoder.? Something like 200 PPR so a dial rotation would come out at 2KHz at 10 Hz.? I bought one on eBay but it is for industrial counting of things and not smooth enough for a VFO.? So most def, I am interested in such a column.
And I like your topic immensely,
Joe N9JR
-- Jack, W8TEE
|
Hi Arv:
I misunderstood what you were saying for the?clear dumb terminal. Your solution works fine, is easy to code...what's not to like? If the column does come into existence, I hope readers will write in with questions. Unfortunately, I won't always have the answer, but perhaps I can find someone who does.
I hope it happens!
Jack, W8TEE
On Friday, May 14, 2021, 5:35:18 PM EDT, Arv Evans <arvid.evans@...> wrote:
Jack
At the risk of giving away some content that may have been better saved
for your column, I was talking about the pseudo dumb terminal that is part
of the Arduino IDE.? To the best of my knowledge there is no command that
be sent by the attached Arduino to clear this pseudo-terminal screen. My solution is to have the Arduino code send a series of "\n" commands
to the dumb terminal emulator.? At 9600 or above this happens so fast that
existing screen content is simply scrolled off the screen and disappears
without even a flicker.?
Code has been added to BitLash to allow it to poll and write to various ports in modes that provide ham radio type interfaces (i.e. SWR, PWR, REV, FWD,
MODE, FREQUENCY, FREQUENCY STEP SIZE, FREQUENCY STEP RATE, VFO-A, VFO-B, VFO-C, VFO-D, and so on).? BitLash can be rebuilt to be both
attached computer with, or without CAT controls for various type of CAT...even
the Schr?dinger's version!
?
As you know, many of those here have only recently started to teach
themselves C-language.? My typical mistakes may be of interest to them as they make similar mistakes and have related questions.? Others are
like me, old codgers with poor memories, and need all the help we can get.
Arv _._
toggle quoted message
Show quoted text
Hi Arv:
All of those would be interesting, but I don't know anything about BitLash other than what it is. Usually, a device being used as a screen (e.g., 16x2 display or TFT color display) will have doc sheets telling what the commands are for a clear screen (and other things, like cursor positioning). Reading push buttons or a keyboard is really the same thing, only a keyboard usually has more switches that the microcontroller has pins, so some kind of interface is normally used. The current project I'm working on (an SDT) uses one pin to control 16 switches, saving me 15 pins for other uses. Those are the kinds of things I want to highlight.
I do have to keep in mind that I need to provide a solution in a fairly small number of paragraphs. Still, I think it would be nice to have a place where software topics can be discussed. If it does happen, I would also like to present the ideas/solutions of others, too.
Jack, W8TEE
On Friday, May 14, 2021, 4:30:42 PM EDT, Arv Evans < arvid.evans@...> wrote:
Jack
Of course I would be interested.? I might even be able to contribute some
problems and maybe some solutions for the column.
Things that immediately come to mind: - How to do a Screen Clear on the dumb terminal in an Arduino IDE.
- How to integrate commands from both push-buttons and a keyboard.
- BitLash, further development for Arduino.
- Using the Arduino dumb terminal with and without keystroke echoing.
- And several more things that have bugged me in my most recent projects.
Arv? K7HKL _-_
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman < kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
-- Jack, W8TEE
-- Jack, W8TEE
|
Jack
Me too.? It sounds like fun!
Arv _._
toggle quoted message
Show quoted text
Hi Arv:
I misunderstood what you were saying for the?clear dumb terminal. Your solution works fine, is easy to code...what's not to like? If the column does come into existence, I hope readers will write in with questions. Unfortunately, I won't always have the answer, but perhaps I can find someone who does.
I hope it happens!
Jack, W8TEE
On Friday, May 14, 2021, 5:35:18 PM EDT, Arv Evans < arvid.evans@...> wrote:
Jack
At the risk of giving away some content that may have been better saved
for your column, I was talking about the pseudo dumb terminal that is part
of the Arduino IDE.? To the best of my knowledge there is no command that
be sent by the attached Arduino to clear this pseudo-terminal screen. My solution is to have the Arduino code send a series of "\n" commands
to the dumb terminal emulator.? At 9600 or above this happens so fast that
existing screen content is simply scrolled off the screen and disappears
without even a flicker.?
Code has been added to BitLash to allow it to poll and write to various ports in modes that provide ham radio type interfaces (i.e. SWR, PWR, REV, FWD,
MODE, FREQUENCY, FREQUENCY STEP SIZE, FREQUENCY STEP RATE, VFO-A, VFO-B, VFO-C, VFO-D, and so on).? BitLash can be rebuilt to be both
attached computer with, or without CAT controls for various type of CAT...even
the Schr?dinger's version!
?
As you know, many of those here have only recently started to teach
themselves C-language.? My typical mistakes may be of interest to them as they make similar mistakes and have related questions.? Others are
like me, old codgers with poor memories, and need all the help we can get.
Arv _._
Hi Arv:
All of those would be interesting, but I don't know anything about BitLash other than what it is. Usually, a device being used as a screen (e.g., 16x2 display or TFT color display) will have doc sheets telling what the commands are for a clear screen (and other things, like cursor positioning). Reading push buttons or a keyboard is really the same thing, only a keyboard usually has more switches that the microcontroller has pins, so some kind of interface is normally used. The current project I'm working on (an SDT) uses one pin to control 16 switches, saving me 15 pins for other uses. Those are the kinds of things I want to highlight.
I do have to keep in mind that I need to provide a solution in a fairly small number of paragraphs. Still, I think it would be nice to have a place where software topics can be discussed. If it does happen, I would also like to present the ideas/solutions of others, too.
Jack, W8TEE
On Friday, May 14, 2021, 4:30:42 PM EDT, Arv Evans < arvid.evans@...> wrote:
Jack
Of course I would be interested.? I might even be able to contribute some
problems and maybe some solutions for the column.
Things that immediately come to mind: - How to do a Screen Clear on the dumb terminal in an Arduino IDE.
- How to integrate commands from both push-buttons and a keyboard.
- BitLash, further development for Arduino.
- Using the Arduino dumb terminal with and without keystroke echoing.
- And several more things that have bugged me in my most recent projects.
Arv? K7HKL _-_
All:
I have an article coming out in (I think) the June issue of CQ that talks a little bit about software. The article is an experiment to see if there is any interest in a quarterly column about software "stuff". There will be an email address at the end of that article where readers can write in and say Yay (I'd like to see more) or Nay (I've seen enough). Rich will take a look at the responses and decide if a column is a good idea. You already know how I feel about it. This encoder thing would be the type of theme for a column. Generally, each column would state a problem (How can I control 16 switches with 1 I/O pin?) and then the article would discuss one solution to it. (There is no such thing as "THE" answer in software, as it's always likely that someone can provide a better answer.)
I know some of you will be interested, but I also know that some of you would rather watch something rust. My goal is to help those who are interested and trick those who don't yet know their interested into giving it a try. After all, you can get started for less than your morning latte, but you may find an exciting new aspect of this hobby we all enjoy so much.
Regardless of the outcome, I sure appreciate Rich at least giving the idea a try.
Jack, W8TEE
On Thursday, May 13, 2021, 7:35:18 PM EDT, barry halterman < kthreebo@...> wrote:
Good information, if you know programming. I am just a dabbler and have limited skills in this area. Although, thanks for the info. Barry On Thu, May 13, 2021, 12:06 PM Dennis Zabawa < kg4rul@...> wrote: This was just an example to show that the 100PPR encoders can be made to work.? Anyone who cares to can feel free to incorporate Jack's suggestion and make the code into a library.
-- Jack, W8TEE
-- Jack, W8TEE
-- Jack, W8TEE
|
Optical encoders that drive a small computer like an Arduino should
be easy to handle in software.? It the number of states per revolution
is too high, just use a software divider to lower the number of states. If the number of mechanical states is too low, it should be easy to
make a state multiplier for 2X, 3X, etc.?
Arv _._
toggle quoted message
Show quoted text
Joe:
There are a lot of optical encoders that can approach 200 ppr, but they're not cheap. I think I saw one on eBay for less that $30, but that was several weeks ago. Some go as high as several hundred dollars...probably way overkill for your needs. What is a "better encoder" to you? I'm working on an SDT and I have a $1.50 encoder in it and it's fine for me. However, I like detents as they prevent me from "coasting" past a desired frequency.
As to buying a subscription, truth be told, almost anything you see in print today can be slightly modified and then posted on the Net. My publisher once told me that for every book I sell, 5 are downloaded for free. The real cost is not what I lose, but the books that don't get written because it's just not worth it anymore. However, we really do need to support the magazines that interest us. Ham Radio, Electronics Illustrated, 73 Magazine, Radio News and others...gone. Give up a dinner out and buy a subscription to one that still exists: CQ, QST, QRPQ, Sprat, RadCom and others...any one of them is worth it.
Jack, W8TEE
Jack,
That would be very cool.? But darn, I¡¯d have to subscribe to CQ.? If they go for it let me know and I¡¯ll subscribe.
I¡¯ve been wondering about a better encoder.? Something like 200 PPR so a dial rotation would come out at 2KHz at 10 Hz.? I bought one on eBay but it is for industrial counting of things and not smooth enough for a VFO.? So most def, I am interested in such a column.
And I like your topic immensely,
Joe N9JR
-- Jack, W8TEE
|
Why not pulley-and+thread the existing encoder to a smaller shaft? If the drum Diameter on the encoder is 10 times the diameter of your tuning shaft, you will be 240 pulses instead of 24.
toggle quoted message
Show quoted text
Optical encoders that drive a small computer like an Arduino should
be easy to handle in software.? It the number of states per revolution
is too high, just use a software divider to lower the number of states. If the number of mechanical states is too low, it should be easy to
make a state multiplier for 2X, 3X, etc.?
Arv _._
Joe:
There are a lot of optical encoders that can approach 200 ppr, but they're not cheap. I think I saw one on eBay for less that $30, but that was several weeks ago. Some go as high as several hundred dollars...probably way overkill for your needs. What is a "better encoder" to you? I'm working on an SDT and I have a $1.50 encoder in it and it's fine for me. However, I like detents as they prevent me from "coasting" past a desired frequency.
As to buying a subscription, truth be told, almost anything you see in print today can be slightly modified and then posted on the Net. My publisher once told me that for every book I sell, 5 are downloaded for free. The real cost is not what I lose, but the books that don't get written because it's just not worth it anymore. However, we really do need to support the magazines that interest us. Ham Radio, Electronics Illustrated, 73 Magazine, Radio News and others...gone. Give up a dinner out and buy a subscription to one that still exists: CQ, QST, QRPQ, Sprat, RadCom and others...any one of them is worth it.
Jack, W8TEE
Jack,
That would be very cool.? But darn, I¡¯d have to subscribe to CQ.? If they go for it let me know and I¡¯ll subscribe.
I¡¯ve been wondering about a better encoder.? Something like 200 PPR so a dial rotation would come out at 2KHz at 10 Hz.? I bought one on eBay but it is for industrial counting of things and not smooth enough for a VFO.? So most def, I am interested in such a column.
And I like your topic immensely,
Joe N9JR
-- Jack, W8TEE
|
You would get 2.4 Farhan!
One turn of tune shaft should turn encoder 10 times to get 240.
At 15/05/2021, you wrote:
toggle quoted message
Show quoted text
Why not pulley-and+thread the
existing encoder to a smaller shaft? If the drum Diameter on the encoder
is 10 times the diameter of your tuning shaft, you will be 240 pulses
instead of 24.
On Sat 15 May, 2021, 8:22 AM Arv Evans,
<arvid.evans@...>
wrote:
- Optical encoders that drive a small computer like an Arduino should
- be easy to handle in software.?? It the number of states per
revolution
- is too high, just use a software divider to lower the number of
states.
- If the number of mechanical states is too low, it should be easy to
- make a state multiplier for 2X, 3X, etc.??
- Arv
- _._
- On Fri, May 14, 2021 at 7:33 PM Jack, W8TEE via
<jjpurdum=[email protected]
> wrote:
- Joe:
- There are a lot of optical encoders that can approach 200 ppr, but
they're not cheap. I think I saw one on eBay for less that $30, but that
was several weeks ago. Some go as high as several hundred
dollars...probably way overkill for your needs. What is a "better
encoder" to you? I'm working on an SDT and I have a $1.50 encoder in
it and it's fine for me. However, I like detents as they prevent me from
"coasting" past a desired frequency.
- As to buying a subscription, truth be told, almost anything you see
in print today can be slightly modified and then posted on the Net. My
publisher once told me that for every book I sell, 5 are downloaded for
free. The real cost is not what I lose, but the books that don't get
written because it's just not worth it anymore. However, we really do
need to support the magazines that interest us. Ham Radio, Electronics
Illustrated, 73 Magazine, Radio News and others...gone. Give up a
dinner out and buy a subscription to one that still exists: CQ, QST,
QRPQ, Sprat, RadCom and others...any one of them is worth
it.
- Jack, W8TEE
- On Friday, May 14, 2021, 6:34:29 PM EDT,
jereed@...
<jereed@...>
wrote:
- Jack,
- That would be very cool.?? But darn, I?€?d have to subscribe to
CQ.?? If they go for it let me know and I?€?ll subscribe.
- I?€?ve been wondering about a better encoder.?? Something like
200 PPR so a dial rotation would come out at 2KHz at 10 Hz.?? I
bought one on eBay but it is for industrial counting of things and not
smooth enough for a VFO.?? So most def, I am interested in such a
column.
- And I like your topic immensely,
- Joe N9JR
- --
- Jack, W8TEE
|
why does this group have people smarter than?me?
toggle quoted message
Show quoted text
You would get 2.4 Farhan!
One turn of tune shaft should turn encoder 10 times to get 240.
At 15/05/2021, you wrote:
Why not pulley-and+thread the
existing encoder to a smaller shaft? If the drum Diameter on the encoder
is 10 times the diameter of your tuning shaft, you will be 240 pulses
instead of 24.
On Sat 15 May, 2021, 8:22 AM Arv Evans,
<arvid.evans@...>
wrote:
- Optical encoders that drive a small computer like an Arduino should
- be easy to handle in software.?? It the number of states per
revolution
- is too high, just use a software divider to lower the number of
states.
- If the number of mechanical states is too low, it should be easy to
- make a state multiplier for 2X, 3X, etc.??
- Arv
- _._
- On Fri, May 14, 2021 at 7:33 PM Jack, W8TEE via
<jjpurdum=[email protected]
> wrote:
- Joe:
- There are a lot of optical encoders that can approach 200 ppr, but
they're not cheap. I think I saw one on eBay for less that $30, but that
was several weeks ago. Some go as high as several hundred
dollars...probably way overkill for your needs. What is a "better
encoder" to you? I'm working on an SDT and I have a $1.50 encoder in
it and it's fine for me. However, I like detents as they prevent me from
"coasting" past a desired frequency.
- As to buying a subscription, truth be told, almost anything you see
in print today can be slightly modified and then posted on the Net. My
publisher once told me that for every book I sell, 5 are downloaded for
free. The real cost is not what I lose, but the books that don't get
written because it's just not worth it anymore. However, we really do
need to support the magazines that interest us. Ham Radio, Electronics
Illustrated, 73 Magazine, Radio News and others...gone. Give up a
dinner out and buy a subscription to one that still exists: CQ, QST,
QRPQ, Sprat, RadCom and others...any one of them is worth
it.
- Jack, W8TEE
- On Friday, May 14, 2021, 6:34:29 PM EDT,
jereed@...
<jereed@...>
wrote:
- Jack,
- That would be very cool.?? But darn, I?€?d have to subscribe to
CQ.?? If they go for it let me know and I?€?ll subscribe.
- I?€?ve been wondering about a better encoder.?? Something like
200 PPR so a dial rotation would come out at 2KHz at 10 Hz.?? I
bought one on eBay but it is for industrial counting of things and not
smooth enough for a VFO.?? So most def, I am interested in such a
column.
- And I like your topic immensely,
- Joe N9JR
- --
- Jack, W8TEE
|