Questions tagged [teensy]
Teensy is a cheap and powerful development board with some Arduino compatibility.
140
questions
1
vote
1
answer
294
views
No output from PCM5102 I2S DAC
I'm trying to connect a HiLetgo PCM5102 I2S DAC to a Teensy 4.0, but I'm not getting any audio out. I have it wired as:
SCK - GND
BCK - BCLK1 (21)
DIN - OUT1A (7)
LCK - LRCLK1 (20)
GND - GND
VIN - +3....
2
votes
2
answers
1k
views
Alternative to polling interrupt flag from main loop?
I am using an ISR, which is written to be as minimal as possible:
volatile bool interrupt1{};
void ISR1() {
interrupt1 = true;
}
The interrupt is handled by polling the interrupt1 variable in ...
0
votes
1
answer
113
views
How do I write efficient callback functions on a Teensy 4.0?
I am looking at refactoring my code by implementing callback functions in order to be able to reuse the abstract logic of other functions/classes.
However, I feel I need to learn more about the limits ...
1
vote
0
answers
76
views
A9G GSM not connecting to teensy 4.0
Below is my current code for connecting to the A9G. As far as I can tell, it never actually opens a connection as HWSERIAL.println("AT"); does not return anything. Any ideas would be ...
2
votes
0
answers
218
views
SD card breakout sometimes does not initialise (SPI connection - Teensy 3.2)
I have connected this Adafruit SD Breakout to a Teensy 3.2 over SPI. Because Teensy 3.2 is 3.3 V, I've connected the 3.3 V pin of the Teensy to the 3V pin of the SD breakout.
See sketch below. I'm ...
0
votes
1
answer
2k
views
Teensy 4.1 / 4.0 When to use FlexPWM vs QuadTimer pins to strobe LEDs
I want to strobe 3 LEDs (at independent frequencies and duty cycles) via mosfets with a duty cycle of 0.05%-1% at a frequency range of 24-100 hz. I would like to hold 1% or better accuracy for both ...
0
votes
2
answers
6k
views
What is the difference between SCLK and CLK pins?
Please do forgive me if anything in this question does not make sense, I am very new to PCB and Arduino.
I am following a tutorial through where the person doing it is making a small data computer (...
1
vote
1
answer
120
views
Why is there a cutoff on these accelerometer measurement values? - ADXL375
I'm using a Teensy 3.2 to read data from an ADXL375 using SPI. In general the communication is going just fine and I can activate settings etc.
However, when I try to read X, Y or Z data it seems like ...
0
votes
1
answer
164
views
Wired Teensy 3.5 AudioShield and RFID RC-522
I received a set of wired Teensy 3.5 AudioShield and RFID RC-522.
The audio shield is mounted on the Teensy but I cannot connect the MFRC522
Using MFR222 library. Pins are set to 0 and 31:
#define ...
1
vote
1
answer
480
views
Connecting Common-Anode Seven Segment Display to Shift Register
I recently wired up the following ill-advised circuit:
A common-anode display is wired with its cathodes connected directly to LEDs connected to ground. But the strange thing is that it worked ...
-1
votes
2
answers
238
views
Send same telemetry data to two different serial ports?
I'm using a Teensy 3.5 to control a wall-following robot. The robot sends telemetry to my PC via two independent ports - Serial1 & Serial. Serial is the normal USB port, used when I direct-...
0
votes
1
answer
2k
views
how can I delete contents of an SD card in arduino?
I have a datafile, datalog.txt I can open, read and write cool. What is the best way to delete all the file contents?
Should I try rewriting the SD card file with NULL data?
I have been reading the &...
1
vote
0
answers
35
views
Help needed to check if my solenoid wiring is correct
I'm planning a new custom keyboard project which involves a solenoid being controlled by a Teensy2.0++, and i would like to power everything with just a USB cable.
I don't have much electronics or ...
2
votes
1
answer
111
views
Pull more than 250 mA from powerbank-powered Teensy 3.6
I'm using a powerbank speced 5V at 2.4A to power my Teensy 3.6 via the USB port. However, Teensy recommends to not pull more than 250 mA from its 3.3V pin.
Is there any way I can pull more current, at ...
0
votes
1
answer
567
views
No response from instrument via serial communication
I am using a Teensy 3.6 to communicate with an external instrument via a serial connection. However, I am not able to get the instrument to respond to my commands.
The idea is to send a command from ...
2
votes
3
answers
2k
views
MPU6050 Calibrating Accelerometer
I recently got an MPU6050 and I noticed the accelerometer data was a bit off, especially on the Z axis.
I'm running it on a Teensy 4.0 with Adafruit's MPU6050 library and basic example code: https://...
1
vote
0
answers
137
views
using pmrpcm library for sound output from Teensy3.2
I converted an MP3 sound effect (5 seconds long) to WAV to play it out of a Teensy3.2 with speaker connected to PWM output pin. The TMRPCM library specifically talks about Arduino AVR boards, but ...
0
votes
1
answer
118
views
Global array doesn't get assigned the space it would take up in memory
I have this sketch:
const uint32_t len = 65536;
uint8_t arr[len];
void setup() {}
void loop() {}
The length of the array should fit into the dynamic memory. However, when I compile the sketch it ...
1
vote
1
answer
487
views
Teensy 4.1 serial communication with 7N2 (7 databits no parity 2 stopbits)
I have ported a project from arduino Due to a teensy 4.1
In the project I read data from a sensor which speaks serial at 7 databits, no parity and 2 stopbits (no configurable).
Now it seems that ...
0
votes
1
answer
151
views
nuttx hex too large
I have a teensy 4.1, and I am trying to install NUTTX the Real Time Operating System ( RTOS ). Teensy is a supported platform.
I am trying install nuttx compiled from source, and upload it using the ...
1
vote
2
answers
1k
views
Teensy4.1 with 2x 8MB PSRAM Chips: external_psram_size=0 but EXTMEM char[] works as expected?
So I got 2x PSRAM chips from PJRC with my Teensy4.1 and soldered them on (it's a hideous job as I lost my tips) but it's all tested with a multimeter and the connections are solid.
I ran the memtest ...
0
votes
2
answers
1k
views
Cannot display a chr string using Wire.read() and u8g2.drawStr()
I'm still getting myself acquainted with C++, so I expect this is a very basic issue I'm facing. I've got an OLED screen connected to a Teensy LC and can display text on it just fine. The Teensy ...
1
vote
1
answer
114
views
What pins to use on a Teensy to get data from multiple peripherals?
I'm using a Teensy to keep records on the location, speed, altitude, and direction of a weather balloon I'm hoping to launch. I have an Adafruit LSM9DS1 and a Ublox NEO-M8N with compass (HMC5833L) so ...
1
vote
1
answer
306
views
Asymmetric encryption on a Teensy?
I want to monitor an input and then send the information in an encrypted way that can't be easily unlocked even if a malicious actor gets access to the device itself. I'm new to using the Teensy ...
2
votes
1
answer
343
views
Updating SPI transfer16 to create Transfer24
It might be a bit out there, but for a project that I am working on, my word size default is 24bits (3x8-bit), of which the first 8-bits are data and the next 16-bits are data. I would like to ...
0
votes
2
answers
466
views
Converting my delays to millis for smoother operation
I need help converting my code to change out the delay() command into the millis() command for smoother operation.
Currently the code only moves after the delay is up. I would like the codes to run ...
0
votes
0
answers
93
views
How can TEENSY Microcontrollers read ASCI Variables from X-PLANE 11
TEENSY Boards have in the USB-MODE "FLIGHTSIM" direct access to the variables = DATAREFS
of X-PLANE 11.
You can use FLIGHTSIMINTEGER and FLIGHTSIMFLOAT but not a varible for CHARs like the ...
2
votes
0
answers
519
views
Teensy 4.1 Ethernet Throughput
Using a socket server on a Teensy 4.1, I am sending and receiving data in a loop from a Windows socket client (WinForms C#.NET).
I am sending or receiving 530 bytes of data. In each direction, it ...
1
vote
1
answer
232
views
Wave file will not play with Teensy 3.5
I am attempting to play a wav file from an SD card using a Teensy 3.5. I am using this buzzer and I have the following code currently:
#include <Audio.h>
#include <Wire.h>
#include <SPI....
1
vote
1
answer
2k
views
Can FastLED be made faster?
I am using FastLED to drive 16 pixels on an addressable WS2812B RGB LED strip. My application has extremely tight timing constraints. Specifically, I need to turn the LEDs on and off within less than ...
1
vote
0
answers
627
views
Serial Monitor Not Displaying
I am using BMP 280 for an altimeter to measure the altitude. Once all connected and uploaded the BMP280test code from Adafruit, the serial monitor says busy. But still, when I switch the port in tools,...
1
vote
0
answers
89
views
How to write analog signals to control throttle of the ship?
I am using teensy 2.0 as DAC. I am trying to write signals on rudder and throttle of the ship via relay. How can I write these analog signals? Should I specify voltage for every pin?
Here is my code:
...
0
votes
1
answer
110
views
Teensy 2.0 MIDI: Number of notes in a chord limited to 6?
I am using the Teensy 2.0 with USBMidi in a project that allows musicians to use retro computers as "instruments" (https://github.com/fredlcore/midijoy). So far, all these computers had no more than ...
1
vote
1
answer
303
views
Why can the Xbox360 not detect the Arduino Leonardo as keyboard?
Arduino Leonardo as keyboard in the computer works! But not with the Xbox360.
The Teensy works perfectly on the PC but how to emulate a keyboard device for the Xbox360.
I know the Xbox360 has ...
-1
votes
1
answer
1k
views
Reading bmp images from SD card, converting it and displaying it on serial monitor in Arduino
Can someone please help me write code that can read a 24-bit BMP file from an SD card, save converted to 8-bit BMP internally, and display the 8-bit BMP pixel values on Arduino terminal as a 2D matrix....
0
votes
1
answer
110
views
Crazy Results with I2C and I2C_Anything()
I have the following code in a Arduino Mega function to retrieve two 4-byte integers from a Teensy 3.2.
Wire.requestFrom(SLAVE_ADDR, sizeof(float)+ 2*sizeof(long));
mySerial.printf("\n<<<<...
0
votes
1
answer
1k
views
Sending MIDI CC to multiple midi Channel
Hi so i would like to send CC messages to different MIDI Channel (volume control). The CC messages are coming from one knob.
The solution i found kind of work but i'm pretty sure is not ideal and ...
0
votes
1
answer
2k
views
how can i conect a lipo charger to a teensy 4.0?
I have the battery charger product https://www.adafruit.com/product/2124
and a teensy 4.0, that I would like to use to power it.
what, if any pin would I connect from bat, to the teensy?
Its my ...
3
votes
3
answers
827
views
Is it possible to program Arduino in transpiled JavaScript?
Coming from JS, I find it very difficult to program Arduino in C++ (not even knowing which version or what features are supported), being bound to the loop and delay, not being able to (easily) use ...
1
vote
1
answer
2k
views
What is the equivilent of PORTx for Teensy (4.0)?
I've seen people use code like PORTB |= 0x1 << 6 to set the sixth bit of PORTB in arduino. I understand that this is significantly faster than using digitalWrite. How can this be done using a ...
1
vote
2
answers
3k
views
Faster TimerOne with Teensy 4.0 (600MHz)
I have a teensy 4.0 which runs at 600MHz, and is double superscaler (i.e. can execute two instructions per clock cycle, sometimes). I need an interrupt to happen faster than every microsecond. I've ...
1
vote
0
answers
140
views
Why is my "port" button on the toolbar greyed out?
I am trying to program a Teensy 3.2 to act as a lightsaber controller. My code works perfectly but I can't select a port. How should I fix this problem?
Here is my code:
/* Presented without ...
0
votes
1
answer
243
views
What would cause a delay when using serial between the Arduino IDE & external clients?
I have been working on a problem for a couple of days that I can't figure out.
I am using a Teensy3.6 with Arduino IDE to build a CAN Bus monitor for a car. For those familiar, I am trying to save ...
1
vote
2
answers
2k
views
Baudrate is set to 9600 automatically even if specifying a different value
You initialize the serial communication via USB with
Serial.begin(baudrate);
where baudrate is a long specifying the number of symbols you want to send over the connection per second. You can put ...
1
vote
1
answer
761
views
Specific ports on Teensy 3.6 not reading correct bit resolution using ADC library?
I have a basic circuit, where I'm reading analog values from 14 infrared receivers.
I set the bit resolution to 16 but specific ports are returning 10 bit values (from 0 - 1024) instead of 16 bit ...
0
votes
0
answers
37
views
VS2019CE/VisualMicro project won't compile without specific reference
I have a small project to test a Sparkfun MPU9250 breakout board. 'Class_MPU9250BasicAHRS_t3.h', 'MPU9250BasicAHRS_t3.h' and 'Class_MPU9250BasicAHRS_t3.cpp' are all in the local project folder. ...
1
vote
0
answers
343
views
Can't open serial monitor on Ubuntu (Teensy 3.2)
I am running a simple blink/hello world program on Teensy 3.2. The code is compiling and running fine but I can't see the serial output. When I try to open the serial monitor it gives me
"Board at ...
0
votes
1
answer
405
views
Python script not reading from serial unless teensy is rebooted
I want to send some analog sensor data from a Teensy 3.2 to a mac running a python script (I am using the usual pyserial module and I send data using Serial.print() in the arduino sketch). I am using ...
1
vote
1
answer
215
views
Parsing and comparing strings on Arduino: different behaviour from gcc?
I am trying to parse a simple string, print the result of the parsing via serial.println, and trigger a function on the basis of the received command. I wrote the code below, which perfectly works in ...
1
vote
0
answers
629
views
Optimizing Teensy 3.6 for data sampling?
So, I have a very basic project where I cycle through 8 IR individual transmitters. After setting the individual transmitter high, I cycle through all 8 IR receivers and print their values, RX_CYCLES ...