fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67176 times)

0 Members and 5 Guests are viewing this topic.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #390 on: November 13, 2018, 09:56:48 PM »
hey, I'm new to this whole proffieboard discussion, and my linux computer isn't recognizing the Proffieboard, so I can't upload anything to it. The link above on the GitHub site gave Linux instructions, but I was unable to figure out what they meant(it's been a few years since I touched a Linux OS.) Any chance someone could tell me in detail what to do?

Open up a shell/xterm/gterm/console whatever it's called in your linux dist.

Cut-n-paste the following two commands:
Code: [Select]
cd ~/.arduino15/packages/profezzorn/hardware/stm32l4/*/drivers/linux/
sudo cp *.rules /etc/udev/rules.d

You'll need to enter the root password when it asks you to.
If you don't have sudo installed, you'll need to run "su", enter the password and then run "cp *.rules /etc/udev/rules.d" after you are root.

Then restart the computer.

Offline CaptainKirkwall

  • No Force
  • *
  • Posts: 3
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #391 on: January 27, 2019, 04:06:02 AM »
Hi, I am completely new to using this card, so I have made V1 with Teensy 3.2, shield and SD card reader. I have tried to follow the instructions to the best of my abilities, but there seem to be a couple of discrepancies in naming of the .h files. I made a file called my_saber.h which is included in lightsaber.ino, but there are also references to v1_config.h. So in my_saber.h i put in #include"config/v1_config.h". Is this correct?

When trying to compile the code I get these error messages:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:549:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\common/battery_monitor.h: In member function 'float BatteryMonitor::battery_now()':

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\common/battery_monitor.h:91:20: error: 'BATTERY_PULLUP_OHMS' was not declared in this scope

     float pullup = BATTERY_PULLUP_OHMS;  // External pullup

                    ^

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\my_saber.h: At global scope:

my_saber.h:20: error: too many initializers for 'Preset'
 };

 ^

my_saber.h:20: error: cannot convert 'StyleFactory*' to 'const char*' in initialization
my_saber.h:23: error: 'bladePowerPin6' was not declared in this scope
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                        ^

my_saber.h:23: error: no matching function for call to 'SimpleBladePtr()'
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:683:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note: candidate: template<class LED1, class LED2, class LED3, class LED4, int pin1, int pin2, int pin3, int pin4> BladeBase* SimpleBladePtr()

 class BladeBase *SimpleBladePtr() {

                  ^

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note:   template argument deduction/substitution failed:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:23: error: template argument 5 is invalid
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
too many initializers for 'Preset'


Apoligies for any stupidity revealed by these errors.

Regards,
Per

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #392 on: January 27, 2019, 11:06:01 AM »
Hi, I am completely new to using this card, so I have made V1 with Teensy 3.2, shield and SD card reader. I have tried to follow the instructions to the best of my abilities, but there seem to be a couple of discrepancies in naming of the .h files. I made a file called my_saber.h which is included in lightsaber.ino, but there are also references to v1_config.h. So in my_saber.h i put in #include"config/v1_config.h". Is this correct?

Assuming *your* config file is in the top level directory, that is correct.

Quote

When trying to compile the code I get these error messages:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:549:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\common/battery_monitor.h: In member function 'float BatteryMonitor::battery_now()':

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\common/battery_monitor.h:91:20: error: 'BATTERY_PULLUP_OHMS' was not declared in this scope

     float pullup = BATTERY_PULLUP_OHMS;  // External pullup

                    ^


The V1 design requires an external pullup resistor for measuring battery voltage.
you need to add a line to your config file like:

#define BATTERY_PULLUP_OHMS 22000  /* 22kohm */

which defines what size resistor you used.

Quote

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\my_saber.h: At global scope:

my_saber.h:20: error: too many initializers for 'Preset'
 };

 ^

my_saber.h:20: error: cannot convert 'StyleFactory*' to 'const char*' in initialization
my_saber.h:23: error: 'bladePowerPin6' was not declared in this scope
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                        ^

my_saber.h:23: error: no matching function for call to 'SimpleBladePtr()'
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:683:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note: candidate: template<class LED1, class LED2, class LED3, class LED4, int pin1, int pin2, int pin3, int pin4> BladeBase* SimpleBladePtr()

 class BladeBase *SimpleBladePtr() {

                  ^

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note:   template argument deduction/substitution failed:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:23: error: template argument 5 is invalid
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
too many initializers for 'Preset'


The rest of these errors indicate that there is something else wrong with your config file, could be as simple as a missing semicolon, but
I can't tell without actually seeing the config file contents.

Quote

Apoligies for any stupidity revealed by these errors.

Regards,
Per


No worries, first time is difficult for everybody.

Offline CaptainKirkwall

  • No Force
  • *
  • Posts: 3
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #393 on: January 28, 2019, 10:36:20 AM »
Hi again and thanks for the update. Adding the definition reduced the number of errors. I include the entire config file for you to see. The compiler dislikes line 48, which is the second line of the blade definitions.

#ifdef CONFIG_TOP
#include "config/v1_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 2
#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
#define ENABLE_SSD1306
#define BATTERY_PULLUP_OHMS 22000  /* 22kohm */

#endif

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


BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(),
    SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },
};
#endif

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


The error messages are like this:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:48: error: 'bladePowerPin6' was not declared in this scope
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                        ^

my_saber.h:48: error: no matching function for call to 'SimpleBladePtr()'
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:683:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note: candidate: template<class LED1, class LED2, class LED3, class LED4, int pin1, int pin2, int pin3, int pin4> BladeBase* SimpleBladePtr()

 class BladeBase *SimpleBladePtr() {

                  ^

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note:   template argument deduction/substitution failed:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:48: error: template argument 5 is invalid
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
'bladePowerPin6' was not declared in this scope

Thanks for looking at this.

Regards,
Per

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #394 on: January 28, 2019, 12:10:19 PM »
Hi again and thanks for the update. Adding the definition reduced the number of errors. I include the entire config file for you to see. The compiler dislikes line 48, which is the second line of the blade definitions.

#ifdef CONFIG_TOP
#include "config/v1_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 2
#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
#define ENABLE_SSD1306
#define BATTERY_PULLUP_OHMS 22000  /* 22kohm */

#endif

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


BladeConfig blades[] = {
 { 0, SimpleBladePtr<CreeXPE2White, CreeXPE2Blue, CreeXPE2Blue, NoLED>(),
    SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },
};
#endif

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


The error messages are like this:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:48: error: 'bladePowerPin6' was not declared in this scope
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                        ^

my_saber.h:48: error: no matching function for call to 'SimpleBladePtr()'
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:683:0:

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note: candidate: template<class LED1, class LED2, class LED3, class LED4, int pin1, int pin2, int pin3, int pin4> BladeBase* SimpleBladePtr()

 class BladeBase *SimpleBladePtr() {

                  ^

C:\Users\Per\AppData\Local\Temp\arduino_build_225039\sketch\blades/simple_blade.h:190:18: note:   template argument deduction/substitution failed:

In file included from E:\Lightsaber\Teensy lightsaber\lightsaber-1.305\lightsaber\lightsaber.ino:741:0:

my_saber.h:48: error: template argument 5 is invalid
     SimpleBladePtr<CreeXPE2White, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(), CONFIGARRAY(presets) },

                                                                                    ^

Multiple libraries were found for "SD.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SD
 Not used: C:\Program Files (x86)\Arduino\libraries\SD
'bladePowerPin6' was not declared in this scope

Thanks for looking at this.

Regards,
Per


The V1 config file isn't set up for six power channels, so it doesn't know what bladePowerPin6 is.
On TeensySaber V2/V3, bladePowerPin6 is pin 5, so if you add this:

#define bladePowerPin6 5

to your config file, it should work better.
Then you just need to hook up a FET or PEX to pin 5 to drive an LED.

Offline CaptainKirkwall

  • No Force
  • *
  • Posts: 3
  • Um...Hello?
Re: TeensySaber Software Discussion
« Reply #395 on: January 30, 2019, 09:44:26 AM »
Marvelous! Just what the doctor ordered. Thanks for your help

Regards,
Per

Offline erlomd

  • Experienced Force User
  • ****
  • Posts: 427
  • "Fog Machines & Lightsaber Reys"
Re: TeensySaber Software Discussion
« Reply #396 on: February 08, 2019, 06:41:19 PM »
Newb Question...

do you "need" two switches to work the teensey? or can you just program it to use only one "all in one" switch?
if so, how?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #397 on: February 08, 2019, 07:10:12 PM »
Newb Question...

do you "need" two switches to work the teensey? or can you just program it to use only one "all in one" switch?
if so, how?

One switch is fine. Most, but not all, functions are still available with a single button.

 

retrousse