Skip to main content
10 votes
Accepted

Alternative to polling interrupt flag from main loop?

If the task is pretty short and time sensitive, your best option is to put it in the interrupt handler. If the task is big and not too urgent (like: it could well wait for a millisecond or so), your ...
Edgar Bonet's user avatar
  • 43.3k
6 votes
Accepted

How can I detect which baudrate a virtual COM port is set to?

From looking at the source it appears that on 32u4 based boards Serial includes extra methods to access the settings from the USB host: see: https://github.com/arduino/ArduinoCore-avr/blob/...
Craig's user avatar
  • 2,120
5 votes
Accepted

What is the equivilent of PORTx for Teensy (4.0)?

All Teensies support digitalWriteFast out of the box. digitalWriteFast compiles to just setting the bit in the right port register. You can not do that faster by direct register manipulation. However,...
luni64's user avatar
  • 261
5 votes
Accepted

What is the difference between SCLK and CLK pins?

"CLK" stands for "CLocK". "S" stands for "Serial". So "SCLK" is "Serial CLocK". You also get "SCL" (often used for I2C) and "...
Majenko's user avatar
  • 105k
4 votes
Accepted

How do I give the ENTER keypress?

You can't just "print" a key like that. You use print for sending text. When you use println it sends an enter key along with your text, so you can do : Keyboard.println("ls -al"); and it will send ...
Majenko's user avatar
  • 105k
4 votes

Hacking old car dvd monitors with arduino

I realize this is an ancient question, but just in case someone else has one of these things, I'll share what I know. I have one of these Sharp LCDs that I typically use as a monitor for a Commodore ...
BYTESHiFT's user avatar
4 votes

Can FastLED be made faster?

By default the fastLed is limiting the refresh rate to 400 fps (i.e. 2.5ms). You can disable that with FastLED.setMaxRefreshRate(0);
Gerben's user avatar
  • 11.3k
4 votes

Teensy4.1 with 2x 8MB PSRAM Chips: external_psram_size=0 but EXTMEM char[] works as expected?

Paul here. I'm the author of that memtest program, and also the creator of Teensy. While luni64 already answered very well about your test program, hopefully I can add some clarity about the ...
Paul Stoffregen's user avatar
4 votes
Accepted

Global array doesn't get assigned the space it would take up in memory

There is no problem here. Only the compiler is a bit smarter than you anticipated. It sees, that you are not using arr anywhere, so it just optimizes it out. There are two ways to prevent that, if you ...
chrisl's user avatar
  • 16.3k
4 votes

Send same telemetry data to two different serial ports?

you can write a simple T output using the base class Print. The standard Arduino Print class doesn't have printf but from your code it looks like the Teense core has printf in Print. class TeePrint: ...
Juraj's user avatar
  • 18k
3 votes

Hacking old car dvd monitors with arduino

Your best bet is to try to take the casing off until you find a company name so that you can get a lead on where to look for documentation. Because until you find out more about how that screen works, ...
Tri's user avatar
  • 73
3 votes
Accepted

How to find the index of the maximum value in an array?

First of all, do you really need int values for the measurements or not? If not, and you have numbers between 0 and 255, switch the values to byte, your microcontroller will thank you. Then, there is ...
frarugi87's user avatar
  • 2,721
3 votes
Accepted

Baudrate is set to 9600 automatically even if specifying a different value

The whole concept of Baud Rate with USB communication is completely meaningless. There is no such thing as "baud rate" over USB. What there is, and what you are confusing with "baud rate" is a ...
Majenko's user avatar
  • 105k
3 votes
Accepted

Why can the Xbox360 not detect the Arduino Leonardo as keyboard?

Like Juraj and Majenko said. Arduino Keyboard library does emulate "Boot Keyboard". I use NicoHood HID library and now it works.
eolandro's user avatar
  • 141
3 votes
Accepted

Teensy4.1 with 2x 8MB PSRAM Chips: external_psram_size=0 but EXTMEM char[] works as expected?

I'm afraid your test program doesn't work as you intended. I tested it with a T4.1 without RAM soldered on and it gives the same result as in your question. You didn't declare your array volatile. ...
luni64's user avatar
  • 261
3 votes
Accepted

No response from instrument via serial communication

The Sparkfun RS232 shifter is not a great device. It relies on whatever it's connected to (on the 9-pin port) providing the negative rail for the EIA-232 voltage levels. That's fine when you connect ...
Majenko's user avatar
  • 105k
3 votes
Accepted

how can I delete contents of an SD card in arduino?

To remove a file use SD.remove("datalog.txt"); SD library's FILE_WRITE is O_READ | O_WRITE | O_CREAT | O_APPEND so it would append at the end of the existing file. to start with an empty ...
Juraj's user avatar
  • 18k
3 votes

Alternative to polling interrupt flag from main loop?

Since you tagged it Teensy: You could also reduce the priority of the interrupt, so that it can be interrupted by higher priority interrupts. Thus you can implement interrupts with longer durations ...
luni64's user avatar
  • 261
2 votes
Accepted

Teensy lc linker script question

The Cortex M does not "have RAM at 0x2000000". The Cortex M is just a CPU. It is down to the chip manufacturer where they choose to place RAM in the memory map. In the case of the MKL26Z64VFT4 used ...
Majenko's user avatar
  • 105k
2 votes

Strange RPM Readings on Teensy 3.2

Without the ground of the teensy connected to the ground of the fan all you will be measuring is noise. Ground is required to complete the circuit between the teensy and the fan.
Majenko's user avatar
  • 105k
2 votes
Accepted

Overwritten EEPROM

In your loop(), you increment repeatedly loopnumber without ever resetting it. You should at the very least replace loopnumber++ ; with loopnumber = (loopnumber+1)%2560 ; Otherwise, when ...
Alphonsos_Pangas's user avatar
2 votes

65 hall effect sensors as switches to be used as a keyboard with a teensy

[Completely rewritten answer] That seems fun. But why 65 keys ? with 64 keys it is easier. You have to test the sensitivity of the hall switches with the magnets to know how far apart the keys must ...
Jot's user avatar
  • 3,246
2 votes

C++ Undefined reference to 'Class:Function()'

As Juraj rightly points out, you have a typo, which should give you the following compile time error: In file included from sketch/Sensor.cpp:1:0: Sensor.h:17: error: 'pivate' does not name a type ...
Greenonline's user avatar
  • 3,032
2 votes
Accepted

Specific ports on Teensy 3.6 not reading correct bit resolution using ADC library?

The Kinesis 66 (the chip on the Teensy 3.6) has two ADC modules. Each one talks to different pins. By default the configuration functions in that library configure ADC0, so unless you tell it ...
Majenko's user avatar
  • 105k
2 votes

Faster TimerOne with Teensy 4.0 (600MHz)

You can use the TeensyTimerTool for this. It provides a generic interface to the hardware timers (TMR, GPT, PIT) and 20 software timers. Since the coupling of the timer peripherals to the ARM core is ...
luni64's user avatar
  • 261
2 votes

Is it possible to program Arduino in transpiled JavaScript?

Even if such a transpiler exists (which I don‘t know) you will still have to deal with the loop structure and the fact that you should avoid using delays. On a microcontroller you have to forget about ...
Sim Son's user avatar
  • 1,869
2 votes

Updating SPI transfer16 to create Transfer24

You can't. The teensy 4.0 has hardware support for 8-bit, 16-bit and 32-bit transfers. Not 24-bit transfers. But at 600MHz the overhead of making a function call is negligible anyway - certainly ...
Majenko's user avatar
  • 105k
2 votes

Cannot display a chr string using Wire.read() and u8g2.drawStr()

This is kind of convoluted to put as a comment and it is sort of an answer, so I'm making it an answer. Just to warn you, I have not tried to compile any of the code snippets here. Wire.onReceive(...
timemage's user avatar
  • 5,299
2 votes

MPU6050 Calibrating Accelerometer

Yes an accelerometer can be calibrated. An offset for each of the 3 accelerometers can be found such that the absolute value of the maximum and minimum values of any given accelerometer axis are ...
st2000's user avatar
  • 7,340

Only top scored, non community-wiki answers of a minimum length are eligible