You might consider this line when millis() grows to more than 23 bits (the size of float mantissa), which takes a little over 2 hours.
float tempo = (float)millis()*0.003f;
You'll gradually lose millis precision. Maybe that matters, or...
Looking at your code I noticed this line:
servo1.attach(14, 500, 2400);
Is there a reason why you deviate from the standard values of 1ms and 2 ms, like so?
servo1.attach(14, 1000, 2000);
Paul
Yes that's what confuses me is the lack of a min voltage for the control signal. Sorry the step up is here:
https://grobotronics.com/dc-dc-converter-step-up-5-24v-2a.html
Yes, I do mean the control signal pin. The specs of the Tower Pro MG90S do not mention a minimum voltage for the control signal amplitude.
I also did not find any specifications of the WHS15024 boost/step-up converter. Do you happen to have specs...
Thanks. I've updated the code with Paul suggestions, and converted my RGB phasing to radians, so now code is working great
I've used std::modf instead of modff, to use radians directly
#include <Arduino.h>
#include <SPI.h>
float twopi = PI *...
uint16_t r = (sin(t + 60.0 * 0.0) * max + max);
uint16_t g = (sin(t + 60.0 * 1.0) * max + max);
uint16_t b = (sin(t + 60.0 * 2.0) * max + max);
Suggests an assumption that sin takes degrees rather than radians, so there are...
The current is not coming from the teensy. Do you mean for the signal pin? If you mean current from the battery I believe it is sufficient if not in excess.
Now I'm not familiar with the Tower Pro MG90s, but when you power them with 6Vdc, is the 3V3 output of the Teensy sufficient amplitude to reliably drive the PWM control signal?
Paul
Operating current is 120-250mA, The part number from the vendor I got it from is WHS15024. The circuit is part of a larger project. The Motors represent the servos. It's voltage rating s 4.8-6V.
please describe in more detail how you are powering them than
Part number, current rating, that sort of detail is essential. A diagram is helpful so we are on the same page.
uint16_t r = (sin(t + 60.0 * 0.0) * max + max);
uint16_t g = (sin(t + 60.0 * 1.0) * max + max);
uint16_t b = (sin(t + 60.0 * 2.0) * max + max);
Suggests an assumption that sin takes degrees rather than radians, so there are...
Servos take a lot of current, please describe in more detail how you are powering them, the current ratings of the parts etc. Also which servos are you using?
Hi!
I am currently using a teensy 4.1 and I am trying to control two servos. Since the voltage requirement for the servos(Tower Pro GM90S) are 4-6v, I am using a voltage step up to power them. This of course increases the current as well. I am...
True to the title of the thread, I was wiring up the two new eyes I bought (see the previous post, #151). Now of course these new eyes have a different wiring layout than the previous eyes. So to test them out, I added jumper wires to the...
Nice catch, Paul. I looked at the question and never thought of that issue with sin(). Since he only needs the fractional part, I think the code can be simplified by using fmodf() rather than modff().
float angle = t + 60.0 * 2.0; //...
According to this fairly recent (Jan 2023) thread, there are no actual schematic or PCB files.
https://forum.pjrc.com/index.php?threads/release-of-teensy-4-1-schematic-and-pcb-files.71735/
Not having good results with the SDRAM board and RA8876 in 16-bit 8080 mode. It's very unstable results:( Been playing with delays with no predictable results even at 2MHz. If I switch to 8-bit mode all of the examples in the Ra8876LiteTeensy...
Hi folks,
It's been awhile since I've had time to do much development and I could use a sanity check on some choices I'm making. I'm working on a project where I need to read in 3 channels of PWM, do some processing, then output 3 channels of...
No matter how hard I search, I can't find teensy4.0's pcb design file. Do you know where I can download the file? Or can I get the file if you have it?
Do note that the pins used for the serial ports are different between the Teensy 3.2 and Teensy 4.x. On the Teensy 3.2, Serial2 was on pins 9 (RX2) and 10 (TX2). On the Teensy 4.x, Serial2 is on pins 7 (RX2) and 8 (TX2).
On both Teensies, only...
Right, that's the problem -- calling sendAfterTouch with 3 arguments does completely different things depending on if you're using usb or serial MIDI. If you're already aware of that, it's possible to work around, but it's a very easy mistake to...
Yes, please. It's entirely obnoxious and I hate it. GCC should learn to shut up. I don't care that something or other changed in GCC 7.1 when we are *SEVERAL* versions ahead of that. Don't care at all. I really do wish the Teensy default compile...
I realize this is an old thread, but I just dug out some Teensies that were sitting idle. Most of them tested fine, but 2 Teensy 4.0 did not. They are not detected when trying to flash via Teensyduino. I'm now using Windows 11, Arduino 2.3.2...
I have no way to test these suggestions, but at least the suggested changes below allows compilation without error . . . maybe this will help you to get started:
Change the following in your sketch above:
#include <FlexCAN.h>
#include...
hello I used code just like this in the past on the 3.2 now moving to a 4.0 and changing some things for new screen but wont upload and gives me errors, could anyone help fix this? I'm not much a coding person. i think it has something to do...
My guess is the sin() function. Its input is in radian units, so ideally you should be giving it numbers between 0 to 6.28 (or whatever Pi * 2 is).
But after your program has run for only 4 seconds, even for the first LED (i == 0) the numbers...
Just scroll down to
Arduino 1.8.x Software Development
on this page, then select your operating system. The Teensyduino for .Arduino 1.8.x will download.
Once you have installed your Arduino 1.8.x (and I find that you have to execute it just...
Diecast boxes are pretty much standard for the stompbox builds.
AK4552 vs AK4452 - of course that was typo, i mean the 32bit 4452.
The volume pot will fit, tested many times in practice, the 3d model is not the type i'm going to use, i've just...
Hi, I am a new student trying to figure out how to make a code that sends out simple can fd messages to a single teensy 4.1 microcontroller. I need help with a sample code that can do this as the example codes I run. come back with many...
This differs from the Arduino MIDI library, which overloads the function name (and thus, can't be extended to allow an optional cable number)
https://fortyseveneffects.github.io/arduino_midi_library/a00032.html#ga8f9445f1808b7aa80535aec7d38de6bb...
I'm testing some new LED strips (HD108) with Teensy 3.2 and I'm noticing some unusual
Animations begin very smooth and beautiful, over time (after one minute) we can notice looking at the LEDs it gradually starts decreasing frame rate.
Resetting...
Instead of TeensyThreads or FreeRTOS, I use a simple cooperative "OS" that I built myself, with mailboxes and queues for inter-task and ISR-to-task communication and this works very well for me. The underlying C queue is shown below, with each...
Apologies if I'm being a bit dense but I don't see how to install 1.59 for IDE 1.8.19. The instrs on the pjrc website seem to assume IDE 2.x on. Can anybody point me in the right direction?
Hi,
Try https://github.com/tsandmann/freertos-teensy
Follow installation instructions, and examples would work easily. Then make your own project.
Another very good example is https://github.com/tjaekel/Teesny_4_1
You can find some post here...