Maybe you have Serial.begin(9600) in your program?
On Teensy, Serial.begin() tries to wait for the Arduino Serial Monitor to connect. It waits up to 2 seconds if your PC begins the USB detection process (called...
USB HID Device Info Program
This Sketch shows information about plugged in HID devices
*** You can control the output by simple character input to Serial ***
R - Turns on or off showing the raw data
C - Toggles...
Look at the xy() function in the OctoWS2811 examples.
This is the one from the File example (in Arduino, click File > Examples > OctoWS2811 > Fire)
// A simple xy() function to turn display matrix coordinates...
I tried searching for a previous answer but could not find one. Maybe my google-fu is weak...
I'm seeing that it takes about 2 seconds for my sketch to start being able to operate. I plug in USB and nothing happens...
I would imagine you'd write the channels mask to the MCTRL CLDOK bits to zero the LDOK bits for all the timers you wish to alter. Then write your new settings to some or all of the 6 timing registers. Repeat for each...
Okay that is the last code I started with - but minor edit to remove 'warning' and (void*)i+1
for (int i=1; i<=threadCount; i++)
threads.addThread(thread_func, (void*)i, threadStackSize); // stack alloc'd from...
Each square is really just the same thing as a 256 long LED strip laid out in a zig-zag pattern, as you can see from their diagram. The OctoWS2811 library doesn't care about the layout of your LEDs, it just provides a...
Doing some or occasional malloc from main thread seems to “unlock” the heap for malloc by the other threads, but I don’t think it’s meant to work that way, and it works only “accidentally”. It never makes sense for top...
Hi All,
I'm working on a project to control some servos with Automation Direct's SureServo2 line of products and I am running into an issue I can't seem to resolve.
I'm currently using Paul's Modbus RTU Library...
I strongly suggest including a test setup for coding.
I would look at https://forum.pjrc.com/threads/70264-EncoderTool as an example.
A 2 by 2 or 2 by 3 setups on 1 or 2 breadboards seems the minimum for me for...
Thanks
"Since querying all the encoders for changes would be a bit tedious, I use the callback onEncoderChanged which will be invoked whenever one of the encoders changed its value. "
You could pass "this" as a...
Not looked deeper but: Problem seems malloc expects to own the RAM space as it understands it based on that first call setting the base pointer - and the main and threads have unique views with regard to stack and the...
I don't understand. What do you mean by "nothing magic"? In my testing, if I comment out the preliminary allocation from the main thread, it doesn't work. If I let it there, it works. Isn't it related to the first...
One other thing I tested was to sometimes free the heap space allocated by the threads and check if new allocations were able to use the empty spaces left on the heap. As far as I could see, it works. So I think malloc...
Hello defragster and joepasquariello!
I have been experimenting with your codes and making some small modifications to try to isolate the problem and find the root cause. Thanks very much for your help so far! :)
I...
I'm assuming you're editing this line when you connect the wires to pins 18 and 19?
if (!bmp.begin_I2C(&Wire2)){ // hardware I2C mode, can pass in address & alt Wire
But I can't see your screen. Maybe...
Hello,
I am trying to get a Teensy project working in the Visual Studio/Visual Micro environment. It does build properly in Arduino 1.8 & also in 2.0.
I had to stick the following line in the Visual Micro...
It seems like even if it works, it's not going to work as expected when the stack pointer for all threads other than the main thread is below the top of the heap. Can you comment on that? One of your first suggestions...
Something odd for sure. Seemed all 4 threads were doing Alloc with post #29 - then some change and only thread 0 and 4 made repeat calls. Then the change indicated in p#30 and then only thread 0 and 1 are active?
...
According to the header file:
bool begin_I2C(uint8_t addr = BMP3XX_DEFAULT_ADDRESS,
TwoWire *theWire = &Wire);
I would try this:
bmp.begin_I2C(BMP3XX_DEFAULT_ADDRESS, &Wire2);
I had the same experience. Made a small, valid change to a working program, and the program stopped working completely. What I think I see in the test results are that malloc() only works (for some undefined time) after...
Hi!
Go here:
https://github.com/DD4WH/audio-guestbook
Scroll down to the section "Compiling the code" and follow the instructions 😀.
Good luck and success!
PS: check your sketchname for typo! Guest, not guist...
Thanks a ton! The mask fixed the issue for channels C & D! I knew it was some dumb mistake on my part.
As for the phase shifting, I did see those resources, but it was my understanding that the Teensy 4.X boards...
Hey, I am making this aswell. I am currently stuck at another section;
In the beginning of the code it says:
#include <Bounce.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include...
I've created a new TeensyLC usb type that emulates an off the shelf device. I've completely tested, and that code is working. When I plug the new Teensy device into a host, the host sees the Teensy as the off the shelf...
Thanks for your reply.
Approximately how long should it take after releasing the button?
Edit: I've got it now. It wasn't working with the 10000mah USB battery is was using.
Solid red light remains for about...
Hold the button until you see the one led just blink and then release it, It should then show that LED lit up for awhile as it reprograms it, and then you should get the blink (the other LED) program on it running.
I've had Teensy 4.0 since it was introduced, recently got a 4.1. I never got around to trying the Automatic Recovery feature.
I've tried it a few times, and haven't gotten it to start running Blink.
I hold the...
@KurtE
Just gave your updated sketch a try and without turning off debug or changed data"
$HIB:ff0d0000 type:2 min:0 max:255
Digitizer: &usage=100(in:FF000100), usage_page=ff00, value=0(0)
Digitizer:...
I pushed up a quick and dirty version: https://github.com/KurtE/lsm6-arduino-Teensy-I2C/tree/Wire12
That is for example with the example sketch:
LSM6 imu; // Will use the wire object
LSM6 imu(Wire1); // will use...
I have done a little more hacking since then,
Including change @mjs513 mentioned.
But also then doing some hacking for the longer version, which is still not right, but gives some more tools to help.
That is...
Just tested it, my setup needs some 200ns delay to get a stable readout.
Here the test code I used to read out the 3x5 encoder-array shown in #6.
#include "Arduino.h"
#include "EncoderTool.h"
#include...
Have you thought about using the EVE4 controller with 5", 7" or 10" display? I've been using an EVE2 5" for years in my race cars, and have just moved to an EVE4 7" display with the teensy 4 (1026x600). More than...
Looks like this should work. Adafruit's library is designed to work with any I2C port, so you shouldn't need to use "#define Wire Wire2" or edit the library to change "Wire" to "Wire2", as is needed with older...
The mask for the C/D FLEXPWM timers is ALT 2 (ref page 515)
*(portConfigRegister(ChannelC)) = 2;//Maske;
*(portConfigRegister(ChannelD)) = 2;//Maske;
See https://www.nxp.com/docs/en/application-note/AN4485.pdf ...
Thanks for your advise. Will look into the mentioned library. Any idea how to get this talking to a script that produces the correct control messages to the DAW?
About the "start small to get a feeling for it", I...
Just added: ftrias/TeensyThreads/issues/38
It was not giving threadsInfo on LAST thread.
Something isn't working as expected? I added int* me in code below - output changed drastically and makes no sense - how does...
I guess I don't understand this part. In my test program (update below), the blocks are allocated in order from lowest to highest address, but with some failures among threads other than the main thread. Error pattern...
If all instances of Wire have been changed to Wire2 this could be removed: #define Wire Wire2
Has this been tested to work on Wire with the appropriate changes?
> proper pullups and wiring?
Some i2c Devices...
Thanks again, defragster. I will test many allocs and frees from different threads and check the pointers to see where the memory is being allocated in the ram.
Hello!
Recently, I have been trying to get data off a BMP388 using pins 24 and 25 (SCL2 and SDA2). I cannot get anything to work. Here is the code I have been using. I really need help.
#include <Wire.h>
#include...
As noted p#11 the first caller to malloc() sets baseline ptr* brkval - that is the 'logic' behind the main thread alloc 'hack':
if (__brkval == 0)
__brkval = __malloc_heap_start;
cp = __malloc_heap_end;
if...
You are correct! That's the exact same behavior I was noticing. In my case I have tested with only the main thread + 1 created thread. Sometimes the thread 1 is unable to allocate memory, but if the main thread tries to...
Please provide a complete/short example showing incorrect function.
If usage was in error forum may help clarify, if the code really is in Error then it needs to be corrected.
Hi,
Firstly, I love the Teensy 4.1.
Although using EEPRPOM.put and EEPROM.get don't throw errors, they do not seem to work correctly.
I've had to use the old EEPROM.write and EEPROM.read methods, with the old...
Thanks, Defragster.
After some thought, I came to a similar conclusion. It looks like my code made frequent, unnecessary passes through this code and timing could well have made the difference. (There were many tests...
If I use 0x483, and recompile, Teensy Loader shows the following:
$ ./prog_teensy41.sh
Teensy Loader, Command Line, Version 2.2
Read "blink_slow_Teensy41.hex": 22528 bytes, 0.3% usage
Found HalfKay Bootloader...
Setting this seems essential: InChar = 0; // Added to fix crash after updating to IDE 1.8.19
When called without any Serial.available() if the prior exit was with:: if (InChar == 10)
It will enter that...
At @KurtE's suggestion I changed line 234 or so to <10 so it should look like this
void Intuos5Controller::hid_input_end() {
if (debugPrint_) Serial.printf("$HIE\n");
if (hid_input_begin_count_) {
// now lets go...
Built the teensy_loader_cli and not sure if I am quite invoking it correctly.
./teensy_loader_cli --mcu=TEENSY41 -wv blink_slow_Teensy41.hex
Unfortunately something is set up wrong in the vm. All I get is a...
still no side buttons. also i don't see my stylus buttons reported anymore in the flood of data...
question: do you also get a huge amount of serial data when you don't touch the tablet at all? mine is sending out...
ok, i have finger tablet to serial interaction :)
here is the output on serial monitor, when i touch it with my fingers:
HPID(64): 02 04 02 90 A1 FA 62 03 5A 00 03 94 78 EA A9 03 6A 00 04 90 B5 DF 7B 04 62 00 06...
Thanks Kurt. I've solved the problem but it leaves behind a puzzle as to why my code ran, bug free, when compiled with 1.8.10. I've greatly simplified the culprit procedure below. Adding the final statement, InChar = 0,...
Opps - I hesitated asking the obvious ... are there any interrupt functions involved that should not be in FLASHMEM.
The Teensy's 1062 has 32KB code cache - so maybe it can get away with it for some time if it stays...
Hey everyone, I am trying to get 4 PWM channels (2 sets of complimentary signals, with one pair phase shifted dynamically.
Below is my current code, it is built from code I found here, as I cannot find any...
Can't get the usb to stay connected in the vm. The changing modes of usb during programming are confusing the QEMU/KVM. I keep seeing the usb device disappearing.
Do I use a) Teensy Ports /dev/ttyACM0 Serial...
Now I am feeling very stupid. After I was adding more unrelated code (for the PDP1) more functions in the Vectrex menu part started to freeze. So I decided to remove the FLASHMEM on all functions in this module. While...
I hope you can understand nobody can say specifically what the problem is with an unseen PCB. The best we can do to help you is offer some suggestions of tests to perform and explain what the technical meaning of those...
The Program signal was High before pushing it in my previous measurements but now after you asked me I checked again and the Program signal is low (tens of mV) before pushing it.
what could be the problem?
malloc() will report that no memory is available if the requested allocation will collide with the stack, as defined by the value of the stack pointer at the time of the call to malloc(). With TeensyThreads, each thread...
Set up an Ubuntu 20.04 VM. Looking to attach the USB port. In $ lsusb, I see something showing up as Van Ooijen Technische Informatica Teensyduino Serial. Hoping that is the correct device to connect to.
$ lsusb...
Here are the forks:
https://github.com/01-BlackHawk-11/lis3mdl-Teensy-I2C
https://github.com/01-BlackHawk-11/lsm6-arduino-Teensy-I2C
What I had in mind was adding a variable that stores the wire address like...
Are these the sensor libraries you're really using?
https://github.com/pololu/lsm6-arduino
https://github.com/pololu/lis3mdl-arduino
If anyone is going to go to the trouble of editing these to properly allow...