Blog Posts

Teensyduino 1.44 Released

Teensyduino version 1.44 has been released.

The 1.44 installers are available at the downloads page.

Arduino 1.8.7 Support

Only a few weeks after 1.8.6, Arduino released 1.8.7.  With a new Arduino comes a new Teensyduino release to support it.

Arduino 1.8.7 fixes several rare but serious bugs, including issues with the IDE being able to start up.  1.8.7 adds no new features, so there’s no need to upgrade from 1.8.6, unless you’ve encountered issues.

Wavetable Synthesis

A little over 1 year ago, a group of students at Portland State University (Ryan Mellmer, Nicholas Craig, Joshua Bucklin, Aida Keifer, Jonathan Jensen, Yu Tang, Connor Delaplane) completed their capstone project to perform wavetable sound synthesis, for playing of musical notes from sound samples.  PJRC provided hardware and Paul “sponsored” the group.  Dr. Bart Massey advised.

The complete code was published on github.  Now with 1.44, this project has been integrated into the Audio library.  It’s now available in the design tool, and the examples can be accessed in Arduino by clicking File > Examples > Audio > Synthesis > Wavetable.

Wavetable data is stored in Teensy’s internal flash memory.  To create the data, Ryan’s team create a Python utility to import and convert Soundfont format files.

A version of their SoundfontDecoder updated for the Audio library is also available on github.

Faster Ports Menu

Teensyduino 1.42 greatly improved how Teensy is shown in Arduino’s Tools > Ports menu.  But under some circumstances on Macintosh and Windows, a noticeable lag could occur when clicking the Tools menu.  1.44 eliminates this interactive delay, so the Tools menu responds quickly.

The Teensy specific Ports menu is implemented by a native helper program called “teensy_ports”, which Arduino automatically runs at startup.  Because this is a native program, it can gain detailed info about USB devices which isn’t available to Java code in the Arduino IDE.  In 1.42 & 1.43, when you clicked the Ports menu, a query was sent to this program.  When it responded, the info would be put into the Ports menu.  But if anything caused a delay in the response, you would see that delay in the appearance of the Tools menu.

Version 1.44 changes teensy_ports to always send USB device changes as they occur.  A dedicated Java thread listens for the incoming USB info and keeps a list of devices in the IDE updated.  When you click the Tools menu, rather than requiring communication back-and-forth, the list already in the IDE’s memory is copied for use by the menu.

This improvement was partially motivated by a conversation with the Arduino developers.  They intend to eventually allow boards like Teensy to provide their own port “discovery” tools, using a JSON-based format.  This is one of the major missing features which requires Teensy to have a special installer, rather than using Arduino’s Boards Manager.

Another benefit of switching to the JSON format, which allows communicating all info Arduino uses, is the Tools > Get board Info menu now works with Teensy.

The multithreaded JSON-based Ports menu was developed on 1.8.6 and ported to 1.8.7 and back-ported to 1.8.5, so you get this speedup on any of those versions.

Linux 64 bit ARM (AARCH64)

Arduino 1.8.7 is the first non-beta Arduino release which supports Linux on 64 bit ARM, also known as “AARCH64”.  Jetson TX1, Jetson TX2 and Odroid C2 are the main platforms needing AARCH64 support today.

However, Arduino’s downloads page still has ARM64 only on the hourly build and beta build sections.  The Arduino 1.8.7 ARM64 file is actually on their server and can be accessed by copying the link to the ARM32 version, and replace “arm” with “aarch64”.

The final hold-up is due to Oracle’s Java runtime environment (JRE) for 64 bit ARM.  It is “headless”, meaning it only supports command line programs.  Unlike the other Linux copies, there is no “java” folder with the correct Java runtime.  As a result, the IDE will use whatever Java runtime exists on your Linux system, which may or may not be compatible.

Here is a copy of Arduino 1.8.7 with a compatible copy of OpenJDK added in the “java” folder.  Other this this addition, it is identical to the Arduino 1.8.7 file on Arduino’s server.

https://www.pjrc.com/teensy/td_144/arduino-1.8.7-linuxaarch64.tar.xz

Just extract this file, then download and run the Teensyduino 1.44 installer.  Like all Linux systems, Teensy’s udev rule file must be installed to access the USB device files.

The default kernel that ships with Jetson lacks the cdc_acm driver needed for USB serial communication.  You can still use Teensy without this this driver, because Teensy Loader uses HID protocol, and the new Ports menu is able to natively detect USB devices even when their drivers don’t load.  But to use the serial monitor with a Teensy programmed to be USB serial, you will need to install the cdc_acm driver.  If following those instructions, you may need to type “./installCDCACM.sh” to run the script, rather than “./installCDCACMModule.sh” as the instructions say.

Obviously AARCH64 support is very new.  If you encounter issues, please report them on the forum.

Hut’s Anti-Hug Hat

Rolf Hut made an awesome Anti-Hug Hat, or personal space protector, for Burning Man this year.

The Dutch scientist wanted to explore working with Teensys and APA102 LEDs – and wanted a way to try to avoid the typical American hug at Burning Man, so he came up with the Anti-Hug Hat.  The hat has acoustic distance sensors around it an when an object (like a person) gets too close, the ring of LEDs around the hat change from green to orange to red.

DIY MIDI foot controller

Rattus_Metallum made a cool DIY MIDI foot controller.

He needed something to control scripted chord progressions in Dreamfoot, an app for free-floating synth pad accompaniment and was inspired by the iRig BlueBoard, but wanted to dumb it down a bit.  He made use of a Teensy 3.2 microcontroller to interpret the switches and send MIDI data over USB. The code for the Teensy was posted by Liam Lacey at Ask.Aduio.

Burning Man Art – Squidartha

Alexander “Wolf” Griffen designed and built Squidartha, a beautiful interactive burn-bot for Burning Man.

In response to Burning Man Arts request for proposals for Burn-bots to be displayed in The Man Pavillion, Wolf came up with the oceanic themed Squidartha.  He was inspired by the intelligence and curiosity of the squid he’s seen while scuba diving.

The 6’6″ tall sculpture features strips of programable LEDs with nine animation patterns driven by a Teensy 3.2 and the OctoWS2811 library.  It included a control panel of 6 buttons for people to interact with the art with each of the buttons activating a different programming sequence.

LED Matrix Top Hat

Matthew Varas made an impressive GIF Playing LED top hat.

The project was inspired by a robotics competition.  Matthew is a mentor for the team an wanted show how to have some fun with engineering.  The hat uses 4 flexible 16×16 RGB LED panels, a Teensy 3.6, other miscellaneous parts, and LOTS of hot glue.

This imugr gallery has a pretty good write up on the assembly process.

Code for the project is available on GitHub.

737-300 FlightSim

Robert Archer has made an amazingly realistic 737-300 flight sim based on the IXEG 733 and X-Plane

Many Teensy’s are used in this build to preform various functions from simple switch inputs and stepper driver signals to more complex ARINC 429 data output.  This incredible flight simulator is controlled with only 1 PC with 40 USB devices and two 50″ 4k TVs!

Robert has some great videos of the flight sim in action on his You Tube channel, including videos like this one showing a behind the scene look at the sim

This video shows Robert on the sim flying from Las Vegas to Santa Barbara.  It’s hard to believe it’s not a real flight! It’s a long video, but the take off and landing are pretty cool to watch.

 

Teensyduino 1.43 Released

Today PJRC is releasing Teensyduino version 1.43.

The 1.43 installers are available now at the downloads page.

Arduino 1.8.6 Support

The main new feature in 1.43 is support for Arduino 1.8.6.  The main reason to upgrade is 1.8.6 can compile your code significantly faster.

Arduino 1.8.6 is the first non-beta Arduino IDE to support parallel compile.  If your computer has a quad-core processor, when rebuilding all files, Arduino may compile up to 4 pieces of code at the same time.  Usually the speed increase is much less than 4 times faster, but still it manages to compile code in much less time than running every compiler process 1 at a time.

When you change boards or settings, a full rebuild of all libraries files must be done for all library files your code uses.  Arduino 1.8.2 to 1.8.5 would often do this full rebuild unnecessarily, especially if you edited any of the library files (not in the Arduino IDE’s editor).  1.8.6 fixes this unnecessary rebuilding.

However, not everything is perfect with 1.8.6.  Several bugs were discovered after release which cause 1.8.6 to crash, especially if certain data files are corrupted.  Teensyduino 1.43 includes fixes for a couple of these bugs.  The rest will be fixed in Arduino 1.8.7, which may appear soon.  When it does, of course we’ll release Teensyduino 1.44 to support it.

Headless Install

The installer now support a “headless” command line install.  This can be useful if you wish to create scripts to automatically install Teensyduino.  The main intended use is for Continuous Integration testing with systems such as Travis-CI.

Run the installer with –dir=<directory> to specify the Arduino install location.  Using this option cases the installer to run automatically without the GUI.

Adafruit has offered to include Teensy in their automated testing script.  Soon this will allow Teensy to be automatically tested (at least to verify libraries compile without error) for all of Adafruit’s libraries!

Bugs Fixed

Several issues are fixed in version 1.43.

  • Fix default Ethernet CS pins on Teensy 2.0 & Teensy++ 2.0.  Old versions of Ethernet would default to the “SS” pin on AVR chips, and if you wanted any other pin your only option was to edit the Ethernet library code!  With the addition of Ethernet.init(pin), you could choose which pin to use, but this change also caused the default to become pin 10, even if SS was a different pin on your board (as it is with Teensy 2.0 & Teensy++ 2.0).  Now the default is restored to the actual SS pin, and you can use Ethernet.init(pin).
  • Fix USB Keyboard ‘#’ for UK & Irish layouts.
  • Generic UDP class support beginMulticast.  Some libraries using multicast need this defined in the board’s core library.
  • Fix USB MIDI hogging transmit buffers.  If you used USB MIDI together with USB Serial or other USB communication, and you transmit USB MIDI messages faster than your computer can process, previously the MIDI message could consume all the USB buffer memory.  This fix prevents MIDI from hogging all the buffers, so the other non-MIDI communication (hopefully) will not stall.
  • Fix FreqCount for use at high frequencies.  A bug which caused very infrequent errors when measuring very high frequencies has been fixed.
  • Fix SerialPlotter for Ports(Teensy).  Previously Arduino’s Serial Plotter would only work if you had selected Tools > Ports from the “Serial” section of the menu.  Now the “Teensy” ports section is fully supported.  When using a “Teensy” port, board disconnect and reconnect are supported.  The plot restarts from zero when you plug the cable in.  Proper stop and restart is also supported when you upload new code.
  • USBHost_t36 fix for Gigabyte keyboard (thanks KurtE).  These special gaming keyboards with “N Key Rollover” should now work.
  • OctoWS2811 update movie2serial.pde for compatibility with Processing 3.4.  This program streams video to large LED projects.  Minor updates were needed to work with the newest version of Processing and its video library.
  • Remove BYTE define.  This was previously included in Teensyduino for pre-1.0 Arduino compatibility.  But some libraries and code tend to use “BYTE” for their own constants and variables, causing a conflict.  This feature for compatibility with ancient Arduino libraries was causing more harm than good.  It’s been removed.
  • Update WS2812Serial documentation.  A mistake in the documentation showed an extra pin, which was never actually supported and can’t work due to hardware limitation.
  • Improve installer help dialog on Windows.  The “Windows App” incompatible with Teensyduino.  The installer now mentions this in the “?” help dialog.
  • Workaround a rare USB buffering issue.  During sustained fast data transfer from a PC to Teensy, a rare bug could cause wrong data to be received after many megabytes of transfer.  A workaround was added to prevent this problem.  Special thanks to Trammell Hudson for providing a test case.
  • Fix for Arduino 1.8.6 startup (Arduino issue #7917).  If any library you have installed has a version number which Arduino 1.8.6 can’t understand, the IDE crashes at startup.  A fix for this problem is included, so you aren’t left with the software unable to run if you have a “bad” library installed.
  • Add Arduino’s fix for slow 1.8.6 menus on Mac (Arduino issue #7935).  Newer versions of Java on Macintosh are much slower to create menus.  The Arduino developers worked around this problem by creating the menus only once, and they’re merely modified when changes are needed.  Teensyduino 1.43 adds this fix to your copy of 1.8.6.