Update is an internal function. As thebigg mentioned in #2, you can simply use write(pos) to set the current encoder value. Doesn't that work?
Library Documentation:...
Type: Posts; User: luni
Update is an internal function. As thebigg mentioned in #2, you can simply use write(pos) to set the current encoder value. Doesn't that work?
Library Documentation:...
See here https://github.com/luni64/TeensyTimerTool/wiki/Basic-Usage#finding-out-the-maximum-timer-period for information how to find out the max supported timer period for the various hard/software...
I have not much experience with MIDI. Just wondering if it is OK to send those messages every 10ms? The encoder library will generate a lot of fast up/down counts if the encoder bounces (which is...
As Kurt mentioned the usual way is to use objdump.exe.
Here an example using PlatformIO:
After compiling, go to the vsCode terminal and cd to your build directory cd...
Of course you can. No restrictions on pins.
Sorry, the TimerTool does not implement any PWM functionality. However, the features of the 32bit GPT timers look promising for this.
Yes
Yes, __has_include works nicely for the standard use case (I'm using it for the TeensyTimerTool)
#if defined __has_include
# if __has_include("optional.h")
# include "optional.h"...
@Kurt, I don't know if you read #4.
I also thought that this is an Arduino issue first, but it turned out (see Edit in #4) that GCC is simply ignoring the #include after the __has_include. Thus...
Question is what does "is using SD library" actually mean? IMHO, the only thing you can detect with __has_include is, if the build sytem added the corresponding -Ipath/to/the/lib directives to the...
Your xyz.h looks broken.
#ifndef _XYZ_H_
# define MTP_Storage_H
# if defined(__has_include) && __has_include(<SD.h>)
# pragma message " __has_include(<SD.h>"
# include...
@BriComp: Yes the link is into the user wiki
@Robber: Yes you can atomically copy a uint32_t on the 32bit ARM Teensies. No need to disable interrupts
Google is much better than the forum search. If, for example, you search for this:
site:forum.pjrc.com joepasquariello after:2022-01-01
you'll get all your forum posts from this year.
Some...
Good to hear that it works for you now. Have fun with the TimerTool
Makes sense. Did you try increasing the priority of the timer interrupt?
Also makes sense. If you look at the TimerTool config file you see that the TMR runs with the default prescaler of...
Probably not. Due to the architecture of the chip the internal busses need some time to sync data. This adds some waiting time at the end of the ISR. The larger the difference of the frequency of...
Just a guess without testing: Per default the PIT runs at 24MHz only. This can generate some relatively large bus sync waiting times. So 1MHz interrupt rate together with your relatively large code...
I'm afraid you can't do this with the current library but tweaking it a bit could help:
I don't know anything about micro_ros but it looks like timer interrupts are handled without waiting for a...
Wow, running Freecad on the RPI! Didn't know that the RPI is that fast by now... I use onshape for mech design. It runs in the browser (no installation required) and is quite state of the art. As...
Interesting. Using the constructor fixed it for the shown example. Can you post a more complete example using your struct showing the effect?
Wild guess: Can it be that your object of S lives in DMAMEM (e.g. new/malloc). This memory is not initialized. Since the ShortName will be assigned the address of SomethingWithALongName at...
Yes it is, and it is not necessary. As already written in #6 all you need to do is to place
#include "Arduino.h" in the very first line of your main.cpp.
Additionally, add the USBHost_t3.6...
I just realized that the code you posted is your complete application. All you need to do is adding an #include "Arduino.h" at top of the file and adding the USB Host library to the project. It then...
Did you include "arduino.h" in main.cpp? VisualTeensy is using plain cpp and does nothing behind your back (as one of its design goals). I.e., you need to include "Arduino.h", you need to forward...
I did a draft of a Encoder Matrix Proto board. The idea is that one can start developing without the tedious wiring of a lot of encoders. After development the board can be easily cut or broken or...
I just had a look at the library code. You can simply attach a nullptr to remove the callback.
I.e.:
SpindleEnc.attachCallback(onEncoderChanged); // attaches onEncoderChanged to SpindleEnc...
Are you sure that you want to change the pitch while the spindle rotates? Thinking of the noise the breaking thread tool makes gives me goose bumps :-))
Seriously;
In your controlling...
See also here https://forum.pjrc.com/threads/70264-EncoderTool?p=306250&viewfull=1#post306250 for a proposal to read out 190 encoders with one Teensy, without additional hardware :-)
I was thinking of a simple shift register, but then I thought why bother with external parts, when a Teensy can directly read out the matrix even faster.
28413
A quick calculation gives the...
That was easy ;-)
You print the current position in the encoder callback. At high encoder speeds the printing is not yet done when it tries to invoke the callback again. This will basically lock...
Thanks, I'll have a closer look later. So, I'll disable the touchdisplay stuff, attach EncSim to pin 0/1 and see if it crashes at about 200kHz right?
The Error_Callback is a left over from development and it not working anymore. I'll remove the leftover code in the next update. The error callback was invoked whenever the internal state machine...
Feel free to post your program or a link to it for a review. My experience is that you can stare for days at some code and don't find a bug while someone else with fresh eyes might see it in minutes....
There is not much syntax to understand. A simple "spindleEnc.setValue(0);" should reset the counter. What exactly doesn't work?
I thought you are interested if the spindle encoder code looses counts? So the stepper shouldn't be an issue for the test right? Just check if the encSim count equals the spindle counts your program...
Inspired by this https://forum.pjrc.com/threads/70233-Using-Teensy-for-big-MIDI-control-surface and the apparent lack of 23S17 IO Expanders I was thinking of yet another encoder multiplexing scheme...
I can reproduce that. Looks like the binary has some issues. Can you try the attached file? The procedure you described is perfectly OK.
Here you go :-)
A few links:
Repo: https://github.com/luni64/EncoderTool
Documentation: https://github.com/luni64/EncoderTool/blob/master/Documentation/Overview.md
Schematics:...
Oh, both variables c0 and c1 need to be int32_t not uint32_t. Sorry for the confusion (never post untested code :-))
Great, if it works just stick with it.
Take a second Teensy and...
Just had a look at Octopart. There are plenty at "unsusal" suppliers. https://octopart.com/search?q=mcp23S17¤cy=USD&specs=0&in_stock_only=1 (click on "show all" below the standard distributor...
Sure, something like this should work (untested, first value will be wrong)
#include "Arduino.h"
#include "EncoderTool.h"
using namespace EncoderTool;
Encoder spindleEnc;
Oh, that's bad. I assume you checked all the usual sources... Just saw RSComponents has 3 on Stock but a MOQ of 5 :-))
Your'e welcome.
Make sure to get a MCP23S17 which is the SPI version. The MCP23017 are I2C which is slower.
Here an example how to use a MCP23S17 to read out encoders with the EncoderTool (working example here: https://github.com/luni64/EncoderTool/tree/master/examples/2_multiplexing/multiplexed_MCP23S17)....
The nice thing about this approach is, the whole thing runs completely in the background. Your foreground code can do whatever it wants, as long as it doesn't disable interrupts your leadscrew will...
If you don't find a possibility to do non blocking writes to the display you might consider a different approach:
If you can assure that the number of encoder counts per spindle rev is always...
Yes, I just looked through my stock of bought but never used parts and found a couple of 23S017. Starting to rain here. So, extending the EncoderTool might be a nice weekend project :-)
Discussions about encoder readout strategies seem to always end up like windows vs. linux discussions :-)
I'm the author of the EncoderTool library which, to avoid those discussions, supports...
Thanks for the shout out but the TimerTool only uses the timing functions, counting is a different thing. I recommend manitous collection of snippets https://github.com/manitou48/teensy4 instead. You...
Thanks, I'll have a look. But this will take some time (working on another project currently...)
Quick Idea, can you change the GPT1/GPT2 to PIT and see if it works then?
Thats nice indeed :-)