One million won't fit into a 16-bit unsigned integer.
Copying the text of the message and pasting it in your message is a lot easier than an image.
Pete
The interrupt for the timer is turned off until the ISR returns. The delay stops the ISR from returning.
An ISR should always be written to be as fast as reasonably possible. Putting a delay in an ISR is not...
Aha. Change square.begin(WAVEFORM_SQUARE); to square.begin(WAVEFORM_PULSE); which also generates +1 and -1 and therefore needs shaping. But then you can use pulseWidth to get whatever duty cycle is appropriate.
...
Sorry, I misread your EDIT comment.
The output of the square waveform does not alternate between zero and one. It is +1 or -1. All that does to your signal is periodically invert it.
One way to handle this is to use...
To use both DACs on the T3.6 you need to use AudioOutputAnalogStereo
AudioOutputAnalogStereo dacs;
and then in the connections reference port 0 (left) and port 1 (right)
AudioConnection ...
Are the yellow and green wires soldered on to the board at the right? It looks like they are jumper wires whose pins might just be pushed into the holes in the board.
Pete
Call handle_Messages from the loop() function and try increasing the heartbeatInterval_RX as I mentioned in #2. When the messages are occurring one every 250ms, there's no need for the receive timeout to be so brief.
...
I don't think this is correct - i.e. it is not interrupt driven. You have to arrange your code such that it calls handle_Messages more frequently than the heartbeat timeout, which is ten milliseconds. If, for example,...
I would guess that runningLeds is calculating an invalid value for the index 'cled' into the ledfunctions array. This calculation:
int tled=st-ct;
float pled=tled/float(st);
boils down to pled = (st-ct)/st
which...
Are you using the Rev D audio board?
Post a photo which clearly shows the audio board and T4.1 connected together.
The audio library works with T4.1
Pete
The default version of irremote (v2.2.3), which is in the Teensy distribution, works on both T2.0 and T3.2 with a TSSP4038 on Pin 2.
I removed the local version (teensy/libraries/irremote) so that there was no...
Your code works on a Teensy 2.0 but not on a Teensy 3.2. It dies when the library's enableIRIn function re-enables interrupts after setting up a timer.
Pete
Pin 13 is the output LED on the T3.2 and doesn't behave quite the same as an ordinary digital input pin. Try using RECV_PIN on pin 14.
BTW. Which IR receiver are you using?
Pete
Hi Kevin,
This is just a wild guess, but try moving one of the ADC to pin 38 (A14). I think it is on the other ADC. Perhaps the library can handle two ADCs on T4.1 if one is on ADC1 and the other on ADC2.
Pete
The audio design GUI says that AudioInputAnalog for T4.0 and T4.1 is "experimental". Perhaps you are stretching things a bit too far? I'm afraid I haven't used it.
Pete
I knew there was something special about AudioInputAnalogStereo. It is only defined for Teensy 3.2, 3.5 and 3.6.
You'll have to use two separate AudioInputAnalog as input to the mixer.
Pete
I've just compiled and ran the code. The change to the mixer gains doesn't help. I removed the call to system_StartupSequence() - what does it do?
Pete
Normally, the sum of the gains into a mixer should be 1 - unless you have controlled the inputs to the mixer to ensure that its output won't exceed the range . Try this:
mixer1.gain(0, 0.5);
mixer1.gain(1, 0.5);
...
No need for an array. You could have a function to read the pot similar to this:
int last_pot = 0;
void read_pot(void)
{
int i = analogRead(POT);
if(i == last_pot)return;
last_pot = i;
if(i < 500) {
...
Here's some code which follows the wikipedia article on the subject.
int p(int yr)
{
return (yr +yr/4 - yr/100 + yr/400)%7;
}
int weeks(int yr)
{
if(p(yr) == 4)return(53);
if(p(yr-1) == 3)return(53);
I didn't know that there was a way of counting the weeks that can put the first few days of January "in week 52 or 53 of the previous year" (from ISO-8601).
I'll try to mangle the code to sort that out.
Pete
Is this question any different than the one in your other thread?
I doubt that multiplying a 40kHz audio signal by a 38kHz square wave is going to conveniently shift the audio down to 2kHz. The square wave has an...
I have a bit of code to calculate the week (and day) number. First calculate the time_t value of the start of the year - only need to do this once:
// Need to adjust for years after 2021
tmElements_t te;
te.Year...
The problem is that timelib uses 1970 as the epoch and the year is offset by that amount. To set the year properly you would have to so this:
te.Year = 2021-1970;
and to print the last two digits you would do...
Have you tried an I2C scanner to see if the device is at least on the bus? If it doesn't find the device, have you got 4.7k pullup resistors on SDA and SCL?
Pete
Perhaps the Bat Detector thread will have something useful for you. It does require the audio board though, but you can then use setI2SFreq to change the default 44.1kHz sampling rate to something higher - e.g. 96kHz.
...
I tested usb host serial on a T4.1 connected to a T3.6.
First, load this receiving program into the T3.6.
// Works on a T3.6 which receives CR/LF from the
// USB host port on a T4.1
// The LED blinks to indicate...
You will always get that "plop" or "click" when you turn a sound on or off very suddenly. You need to ramp the sound up and then down to avoid this.
Try these settings, as a start:
envelope1.delay(0.0f);
...
The syntax for the two-dimensional array is wrong. It should be this:
const int CCID = {{11,11,11,1,1,11},{11,11,1,11,1,11},{11,1,11,11,1 ,11},{1,11,11,11,1,11},{11,11,11,11,1,1}};
Similarly, the reference to the...
You're absolutely right. I misread it. Sorry.
If you just want to see the spectrum of the guitar sample, There's a variable that is set to 0, 1 or 2 when you push the buttons. It is initially zero. If you initialize...
You need to install the three buttons to use the complete example code. By default it uses SDTEST1.WAV as the audio input to the FFT. Each of the three buttons selects a different input.
// Left button starts playing a...