Teensy 4.0 build for kids

Hi, all

I work with kids in a local high school where most of them are not exposed to electronics/tech.
What I want to be able to do is show a full Proffie saber in all its glory and then “build” a basic saber on a breadboard with them to open their eyes.

I got a teensy4.0 board and am having issues just complaining in Teensyduino:

Multiple libraries were found for "SD.h"
In file included from /Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/config/korbanth_starkiller_v2_doubleCC.h:3:0,
 Used: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Teensyduino.app/Contents/Java/libraries/SD
                 from /Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/ProffieOS.ino:44:
/Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/config/proffieboard_v2_config.h:87:2: error: #error Please select Proffieboard V2 in Tools->Board
 #error Please select Proffieboard V2 in Tools->Board
  ^
/Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/config/proffieboard_v2_config.h:90:2: error: #error Tools->DOSFS should be set to SDCARD (SPI)
 #error Tools->DOSFS should be set to SDCARD (SPI)
  ^
In file included from /Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/ProffieOS.ino:138:0:
/Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/i2c_t3/i2c_t3.h:31:2: error: #error "Sorry, i2c_t3 only works on Teensy LC and 3.x.  Use Wire for Teensy 4.0, 4.1, MicroMod."
 #error "Sorry, i2c_t3 only works on Teensy LC and 3.x.  Use Wire for Teensy 4.0, 4.1, MicroMod."
  ^
In file included from /Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/blades/ws2811_blade.h:30:0,
                 from /Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/ProffieOS.ino:553:
/Volumes/Pegasus R4i/Software/Sabers/Current Sabers/Korbanth SK Apprentice 2 copy/Proffie/ProffieOS/blades/stm32l4_ws2811.h:4:27: fatal error: stm32l4_timer.h: No such file or directory
compilation terminated.
Error compiling for board Teensy 4.0.
``

Any hints?
1 Like

Teensy 4.0 is not currently 100% supported in ProffieOS.
In particular, there is currently no support for neopixels.
Also, it seems that you have a config file written for a proffieboard, which will not work.

We could maybe add neopixel support, but we’ll also need to figure out how to make sound, an SD card reader and what to use for a motion chip, and ideally soemthing to cut the power to the neopixels when not in use. (FETs) A proffieboard has all of these things on it, a Teensy does not.

I’m happy to support education whenever I can, so I’m happy to work with you to figure these things out.

Some options to consider:

  1. use a proffieboard
  2. use a Teensy 3.2 + SD card reader + FET + PJRC prop shield (Teensy Saber Electronics)
  3. forge ahead with the Teensy 4.0 + everything else you need and add support to ProffieOS (or write custom software) as you go.
  4. Some combination of all of the above.

I can help with some software things, but my time is fairly limited, so I wouldn’t be able to add a LOT of stuff for this.

To add, anyone would like to contribute are welcome. The goal is to get kids who would otherwise not be exposed to “tinkering” excited about whats possible.

My wife works as a school counselor at a school with kids from disadvantaged backgrounds.

Ok, do we think a 3.2 will be available generally for a while to come? (IE if other schools pick it up?) - I know its subjective.

My goal is “as simple as possible” with a neopixel strip for cool factor.


Ordered! Onward and upward!

PJRC has been very good about keeping products available for as long as people want them. If you want to get the final word on this, I suggest contacting PJRC directly. They are easy to get hold of and easy to talk to.

I think if I was doing this for education, I would replace the prop shield with an MPU-6050 breakout and a MAX98357A breakout board from adafruit. This is basically a “TeensySaber V3” board, but each circuit is a separate board. (And a different motion chip, but MPU-6050 is already supported by proffieOS)

Once the kids understand how the circuits work, they could populate and bake their own V3 teensysaber PCBs, which would make the whole thing small enough to fit in a lightsaber hilt. :slight_smile:

Trying to keep everything on amazon, this a good option:

https://www.amazon.com/MPU-6050-MPU6050-Accelerometer-Gyroscope-Converter/dp/B07RXQGGJX/ref=sr_1_3?crid=OZHHUWBQO2CH&keywords=MPU-6050&qid=1640558016&sprefix=mpu-6050%2Caps%2C52&sr=8-3

Thats shooting a little high :wink: What I will do is to get them a link to a proffieboard and and a bill of materials for a basic saber.

There are also kids who are mechanically inclined for taping and work on hilts… so who knows.

This will be their introduction:

Not necessarily. SMT assembly is not that hard, and not that expensive. All you need is some good maginification, a $20 skillet, tweezers, solder paste and all the components.

The hard part is to test and fix it if you end up with a short somewhere, that’s why it’s important to have put together the circuits on a breadboard first so that you can learn that each chip is connected to the CPU separately, and if everything works except for the motion, then even if you can’t see the problem, you probably need to lift and re-solder the motion chip.

In my oppinion, SMT assembly is less work than regular soldering, but with a higher rate of errors.

1 Like

this is a wonderful idea.
well done for coming up with something for kids that may never get the chance to experience something like this!
this will help inspire the next generation and hopefully start something further generations will benefit from in the future.

I have 2 Teensysaber Shields for the Teensy 3.2, Im willing to donate to the cause. When added to the teensy 3.2, it makes a TeensySaberV3, which is supported by ProffieOS.

1 Like

Alright, got my Teensy 3.2 programmed, but of course very little in the way of debugging info :wink:

Of course “nothing is happening” - so my question is this, as we would want to build up individual components as we go.

So, to start I would like to wire a single button up and have a single WS2811 strip driven (30 LEDs)

I have a power button shorting pin 16 (A2) to ground.
I have a 10K resistor between ground and pin 16 for presumably defining a WS2811 strip
I have a 52Ohm resistor between the WS2811 data line and Pin 16.

A few things:
I can verify that my power pin goes high when I press the button and low again when I press it again

1…Id like to power this first base level from USB and keep it as simple as possible.
2…What other issues will block power-up?

// This config file contains all the things should be the same for all
// V3 teensysaber configurations. In most cases there should be no need
// to change anything in this file.

#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define V2
#define V3
//#define USE_I2S
//#define GYRO_CLASS LSM6DS3H

// Teensy 3.2 pin map:
// A lot of these can be changed, but be careful, because:
//   o The pins used by the prop shield cannot be easily changed.
//   o Pins that are going to control normal LEDs (not neopixels) need PWM capability,
//     and not all teensy pins can do PWM.
//   o Touch input is not available on all pins.
//   o Sdcard chip select pin depends on what shield you use.
//   o Battery level and blade identification needs analog input, which is not possible
//     on all pins.
//
// See the teensy 3.2 pinout diagram for more info: https://www.pjrc.com/teensy/pinout.html
enum SaberPins {
  // Bottom edge (in pin-out diagram)
  sdCardSelectPin = 0,            // (See File->Example->SD->ReadWrite for
                                  // other possible values.)
  amplifierPin = 1,               // Amplifier enable pin (TeensySaber V2)
  motionSensorInterruptPin = 2,   // motion sensor interrupt (TeensySaber V2)
  bladePowerPin4 = 3,             // Optional power control (TeensySaber V2)
  bladePowerPin5 = 4,             // Optional power control (TeensySaber V2)
  bladePowerPin6 = 5,             // Optional power control (TeensySaber V2)
  bladePowerPin1 = 6,             // blade power control
  spiLedSelect = -1,              // APA102/dotstar chip select
  spiLedDataOut = 7,
  spiLedClock = 8,
  bclkPin = 9,                    // BCLK (digital audio)
  bladePowerPin2 = 10,            // blade power control
  spiDataOut = 11,                // spi out, serial flash, spi led & sd card
  spiDataIn = 12,                 // spi in, serial flash & sd card

  // Top edge
  spiClock = 13,                  // spi clock, flash, spi led & sd card
  batteryLevelPin = 14,           // battery level input
  auxPin = 15,                    // AUX button
  powerButtonPin = 16,            // power button
  aux2Pin = 17,                   // AUX2 button
  i2cDataPin = 18,                // I2C bus, Used by motion sensors
  i2cClockPin = 19,               // I2C bus, Used by motion sensors
  bladePin = 20,                  // blade control, either WS2811 or PWM
  bladeIdentifyPin = 20,          // blade identify input / FoC
  bladePowerPin3 = 21,            // blade power control
  txd0Pin = 22,                   // TXD0 (digital audio)
  lrclkPin = 23,                  // LRCLK (digital audio)
};

#ifndef TEENSYDUINO
#error Please select your Teensy model from Tools->Board
#endif

See my post above your most recent post. You can add sound and light through the simple addition of the shield board Fredrik designed for the Teensy 3.2. I have at least 2 of them I can send to you for the cause.

That would be awesome! Much appreciated. Ill DM you an address as well.

Ultimately I would like to go slow at the start and explain things like WS2811 protocols etc and then point them at a Proffieboard 3 :wink:

Im going to try run a WS2812B string - which is ugly and low powered - but makes the build a lot simple… ordered and on its way.

Have you tried using the serial monitor?
It should say things when you press buttons and such.
Of course, if you don’t have all the components hooked up, it’s possible that ProffieOS freezes somewhere. You can possible work around that by disabling part of the code. (By commenting out some of the ENABLE_**** defines from you config file.)

Not sure why you have this.
If this is intended as a “blade ID” resistor, then it’s on the wrong pin.
Also, you don’t need a “blade ID” resistor.

The WS2811 data line can’t be the same pin as your power button.
Try Pin 20.

USB doesn’t have a lot of power, so don’t plug in more than one neopixel for now.

Te only two things I can think of would be SD card and motion chip. Both of which can be disabled in the config file. (I hope, that part isn’t well maintained, so sometimes it breaks.)

The thing you posted isn’t a config file. It’s a board definition file.
I recommend starting the the V1 board definition file instead.

Yup - working on it:
This is just an update… Im going to see how far a 2812B will go…

No I2C clock pullup detected.
I2C TRY
No I2C clock pullup detected.
EVENT: Power-Pressed ON millis=945264
EVENT: Power-Released ON millis=945383
EVENT: Power-Shortclick ON millis=945383
unit = 0 vol = 0.50, No sounds found: in
Amplifier off.
I2C TRY
No I2C clock pullup detected.
I2C TRY
No I2C clock pullup detected.
I2C TRY
No I2C clock pullup detected.
I2C TRY

This means that it’s running.
The I2C will fail until you provide a motion chip, but everything else would still work.
You should be able to avoid all the spamming by removing ENABLE_MOTION from your config file until then.

Sweet,

Got the basics working just fine now: Teensy - YouTube

Was there any audio implemented within the Teensy 3.2 or (as it looks) an external DAC required via the prop shield?

1 Like

I think this is how I’ll build out the functionality as they learn:
1…Start with just the Teensy 3.2 and a button lighting up a power LED.
2…Add 28xx pixel strip.
3…Add 6050 Board for clash effect.
4… Talk about consolidating Audio+6050+SD and introduce the shield.
5… Sent them to a parts list for a full Proffie/Neopixel/Button/Hilt etc

1 Like