fiduciary

Author Topic: TeensySaber Software Discussion  (Read 17399 times)

0 Members and 2 Guests are viewing this topic.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 867
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #375 on: July 27, 2018, 07:13:25 PM »
How many color profiles per font?

Teensysaber doesn't really work like that. There is an unlimited number or presets, each preset specifies which fonts to use and what colors/effects to use.

Offline Seth Skywalker

  • Padawan Learner
  • **
  • Posts: 99
  • That lightsaber... is mine!
Re: TeensySaber Software Discussion
« Reply #376 on: July 27, 2018, 07:41:14 PM »
How many color profiles per font?

Teensysaber doesn't really work like that. There is an unlimited number or presets, each preset specifies which fonts to use and what colors/effects to use.
Ah, I see. TY

Offline Valereandota

  • No Force
  • *
  • Posts: 7
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #377 on: August 18, 2018, 12:49:45 PM »
Hello there,

I got a Teensy 3.2 and have a problem with the crossguard, it's probably something dumb for someone experienced lol.
1. As soon as I pull out the kill key the crossguards light up. Wiring triple checked. 2. Aux button doesn't seem to work. Appreciate any help.



#ifdef CONFIG_TOP
#include "v3_config.h"
#define NUM_BLADES 3
#define NUM_BUTTONS 2
#define VOLUME 800
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS


// Fire speed, valid values are 1 - 10
#define FIRE1_SPEED 2
// How long to wait before firing up crossguards.
#define FIRE1_DELAY 800

// Each of these have three values: A, B, C
// A = non-random intensity
// B = random intensity
// C = cooling
// The first two control temperature, and as we add
// A + rnd(B) to the base of the blade each animation frame.
// The second controls how rapidly the fire cools down

// This is used during normal operation.
#define FIRE1_NORMAL 0, 1000, 2

// This is used when a clash occurs
#define FIRE1_CLASH  3000, 0, 0

// This is used during lockup.
#define FIRE1_LOCKUP 0, 5000, 10

// Helper
#define FIRE1PTR(NUM, DELAY) \
  StyleFirePtr<RED, YELLOW, NUM, DELAY, FIRE1_SPEED, \
    FIRE1_NORMAL, FIRE1_CLASH, FIRE1_LOCKUP>()


Preset presets[] = {
  { "TeensySF", "tracks/mars.wav",
    FIRE1PTR(0, 0),
    FIRE1PTR(1, FIRE1_DELAY),
    FIRE1PTR(2, FIRE1_DELAY),
  },
  { "SmthJedi", "track..wav",
    StyleNormalPtr<RED, WHITE, 200, 300>(),
    StyleNormalPtr<RED, WHITE, 200, 300>(),
    StyleNormalPtr<RED, WHITE, 200, 300>()
  },
  { "SmthGrey", "tracks/venus.wav",
    StyleRainbowPtr<300, 800>(),
    StyleRainbowPtr<300, 800>(),
    StyleRainbowPtr<300, 800>()
  },
  { "SmthFuzz", "tracks/mars.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
    StyleNormalPtr<CYAN, WHITE, 300, 800>(),
     StyleNormalPtr<CYAN, WHITE, 300, 800>()
  },
  { "RgueCmdr", "tracks/mercury.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >()
  },
  { "TthCrstl", "tracks/uranus.wav",
    StyleFirePtr<BLUE, CYAN, 0>(),
    StyleFirePtr<BLUE, CYAN, 1>(),
    StyleFirePtr<BLUE, CYAN, 2>()
  },
  { "TeensySF", "tracks/venus.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(),
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >()
  },
  { "SmthJedi", "tracks/mars.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(),
    StyleNormalPtr<WHITE, RED, 300, 800, RED>()
  },
  { "SmthGrey", "tracks/mercury.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(),
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>()
  },
  { "SmthFuzz", "tracks/uranus.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(),
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >()
  },
  { "RgueCmdr", "tracks/venus.wav",
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>(),
    StyleNormalPtr<Gradient<RED, BLUE>, Gradient<CYAN, YELLOW>, 300, 800>()
  },
  { "TthCrstl", "tracks/mars.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(),
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>()
  },
  { "TeensySF", "tracks/mercury.wav",
    &style_pov,
    StyleNormalPtr<BLACK, BLACK, 100,100>(),
    StyleNormalPtr<BLACK, BLACK, 100,100>(),
  },
  { "charging", "notrack.wav",
    &style_charging,
    StyleNormalPtr<BLACK, BLACK, 100,100>(),
    StyleNormalPtr<BLACK, BLACK, 100,100>(),
  },
};


// Hook up the main blade as normal.
// Hook up one of the crossguards like this:
//  NEOPIXEL  +    <--> positive power (probably from charge port)
//  NEOPIXEL  -    <--> LED4 pad on the bottom of the teensysaber
//  NEOPIXEL data  <--> Pin 7 on the teensy  (through a 100ohm resistor)
// Hook up the other crossguards like this:
//  NEOPIXEL  +    <--> positive power (probably from charge port)
//  NEOPIXEL  -    <--> LED5 pad on the bottom of the teensysaber
//  NEOPIXEL data  <--> Pin 8 on the teensy  (through a 100ohm resistor)

BladeConfig blades[] = {
  { 0, // blade ID resistor not used
    // Main blade, 144 LEDs
    WS2811BladePtr<12, WS2811_800kHz | WS2811_GRB>(),
    // First crossguard, 26 LEDS, power on LED4, data on pin 7
    WS2811BladePtr<21, WS2811_800kHz | WS2811_GRB, 7, PowerPINS<bladePowerPin4> >(),
    // First crossguard, 26 LEDS, power on LED5, data on pin 8
    WS2811BladePtr<21, WS2811_800kHz | WS2811_GRB, 8, PowerPINS<bladePowerPin5> >(),
    CONFIGARRAY(presets)
  },
};

#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
#endif

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 867
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #378 on: August 19, 2018, 11:21:49 AM »
Hello there,

I got a Teensy 3.2 and have a problem with the crossguard, it's probably something dumb for someone experienced lol.
1. As soon as I pull out the kill key the crossguards light up. Wiring triple checked. 2. Aux button doesn't seem to work. Appreciate any help.


Configuration looks fine as far as I can tell.
First question: Are you sure this configuration is actually what the saber is using?
(did you upload it? Did you modify lightsaber.ino to use this configuration?)

Second question: Can you post some pictures of the wiring? Ideally it should show where everything is going, but that can be difficult if it's in the hilt.

Offline piccolo831

  • No Force
  • *
  • Posts: 2
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #379 on: August 20, 2018, 10:08:24 AM »
Greetings all

First time on the forums and I am learning the Teensy setup. So I am attempting to compile the code and I get the following Error:

lightsaber:723: error: #error NUM_BLADES is too big
 #error NUM_BLADES is too big
  ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
#error NUM_BLADES is too big

*******************

the config file I am using is from the Teensy Saber Electronics V3 page

#ifdef CONFIG_TOP
#include "v3_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "SmthFuzz", "tracks/uranus.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "TthCrstl", "tracks/mars.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "TeensySF", "tracks/mercury.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"}
};
BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

**************

So what am I missing here?

I selected from the dropdown

Blades / LEDs   Buttons
3-Channel Star LED / Momentary Button

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 867
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #380 on: August 21, 2018, 07:21:14 PM »
Greetings all

First time on the forums and I am learning the Teensy setup. So I am attempting to compile the code and I get the following Error:

lightsaber:723: error: #error NUM_BLADES is too big
 #error NUM_BLADES is too big
  ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
#error NUM_BLADES is too big

*******************

the config file I am using is from the Teensy Saber Electronics V3 page

#ifdef CONFIG_TOP
#include "v3_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "SmthFuzz", "tracks/uranus.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "TthCrstl", "tracks/mars.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "TeensySF", "tracks/mercury.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"}
};
BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

**************

So what am I missing here?

I selected from the dropdown

Blades / LEDs   Buttons
3-Channel Star LED / Momentary Button

I think the error is somewhere else, the config file looks fine.
Did you update lightsaber.ino to point to your config file?
Did you make any other changes?

Offline piccolo831

  • No Force
  • *
  • Posts: 2
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #381 on: August 22, 2018, 06:35:44 AM »
Greetings all

First time on the forums and I am learning the Teensy setup. So I am attempting to compile the code and I get the following Error:

lightsaber:723: error: #error NUM_BLADES is too big
 #error NUM_BLADES is too big
  ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
#error NUM_BLADES is too big

*******************

the config file I am using is from the Teensy Saber Electronics V3 page

#ifdef CONFIG_TOP
#include "v3_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "SmthFuzz", "tracks/uranus.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "TthCrstl", "tracks/mars.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "TeensySF", "tracks/mercury.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"}
};
BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

**************

So what am I missing here?

I selected from the dropdown

Blades / LEDs   Buttons
3-Channel Star LED / Momentary Button

I think the error is somewhere else, the config file looks fine.
Did you update lightsaber.ino to point to your config file?
Did you make any other changes?

Yeah I did

/ You can have multiple configuration files, and specify which one
// to use here.

#define CONFIG_FILE "config/mysaber_config.h"
//#define CONFIG_FILE "config/default_v3_config.h"

So I am not sure why it is failing either...

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 867
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #382 on: August 22, 2018, 07:24:36 AM »
Greetings all

First time on the forums and I am learning the Teensy setup. So I am attempting to compile the code and I get the following Error:

lightsaber:723: error: #error NUM_BLADES is too big
 #error NUM_BLADES is too big
  ^
Multiple libraries were found for "SD.h"
 Used: /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/SD
 Not used: /Applications/Arduino.app/Contents/Java/libraries/SD
#error NUM_BLADES is too big

*******************

the config file I am using is from the Teensy Saber Electronics V3 page

#ifdef CONFIG_TOP
#include "v3_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 1
#define VOLUME 1000
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 1.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#endif

#ifdef CONFIG_PRESETS
Preset presets[] = {
   { "TeensySF", "tracks/venus.wav",
    StyleNormalPtr<CYAN, WHITE, 300, 800>(), "cyan"},
   { "SmthJedi", "tracks/mars.wav",
    StylePtr<InOutSparkTip<EASYBLADE(BLUE, WHITE), 300, 800> >(), "blue"},
   { "SmthGrey", "tracks/mercury.wav",
    StyleNormalPtr<RED, WHITE, 300, 800>(), "red"},
   { "SmthFuzz", "tracks/uranus.wav",
    StylePtr<InOutHelper<EASYBLADE(OnSpark<GREEN>, WHITE), 300, 800> >(), "green"},
   { "RgueCmdr", "tracks/venus.wav",
    StyleNormalPtr<WHITE, RED, 300, 800, RED>(), "white"},
   { "TthCrstl", "tracks/mars.wav",
    StyleNormalPtr<AudioFlicker<YELLOW, WHITE>, BLUE, 300, 800>(), "yellow"},
   { "TeensySF", "tracks/mercury.wav",
    StylePtr<InOutSparkTip<EASYBLADE(MAGENTA, WHITE), 300, 800> >(), "magenta"},
   { "SmthJedi", "tracks/uranus.wav",
    StyleStrobePtr<WHITE, Rainbow, 15, 300, 800>(), "strobe"}
};
BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(), CONFIGARRAY(presets) },
};
#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

**************

So what am I missing here?

I selected from the dropdown

Blades / LEDs   Buttons
3-Channel Star LED / Momentary Button

I think the error is somewhere else, the config file looks fine.
Did you update lightsaber.ino to point to your config file?
Did you make any other changes?

Yeah I did

/ You can have multiple configuration files, and specify which one
// to use here.

#define CONFIG_FILE "config/mysaber_config.h"
//#define CONFIG_FILE "config/default_v3_config.h"

So I am not sure why it is failing either...

Try downloading the latest proffieos version and add your config file to it.
Maybe your cat walked over the keyboard or something, and starting over will fix it?
If that doesn't help, zip up the whole lightsaber directory and send it to hubbe@hubbe.net (and then drop a note here so I can find it in my spam folder) and I'll take a look at it.