fiduciary

Author Topic: TeensySaber Software Discussion  (Read 67108 times)

0 Members and 1 Guest 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 #45 on: June 06, 2017, 03:29:17 PM »
Got a batch of 20 teensysaber boards today. :)
Sales will begin as soon as I have time to test them.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: TeensySaber Software Discussion
« Reply #46 on: June 06, 2017, 03:42:24 PM »
Got a batch of 20 teensysaber boards today. :)
Sales will begin as soon as I have time to test them.

Wahoo:)!

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #47 on: June 09, 2017, 12:43:59 AM »
So I upgraded a toy saber with a 6-segment LED string today. (Started yesterday.)
The thing only has one button, and I use that as a kill switch, so I had to add support for twist-on/off. (Currently only active if you define NUM_BUTTONS as 0)
Also, it was starting to feel cumbersome to not be able to have separate set of configurations for each saber, so I broke out most of the configuration stuff into a separate file, of which there are three right now. (One of each of my sabers.)
I've uploaded my changes to github and will upload to my site after some testing as usual.

Offline gmcivor

  • Force User
  • ***
  • Posts: 140
  • Do or do not. There is no try.
Re: TeensySaber Software Discussion
« Reply #48 on: June 12, 2017, 10:44:58 AM »
So I upgraded a toy saber with a 6-segment LED string today. (Started yesterday.)
The thing only has one button, and I use that as a kill switch, so I had to add support for twist-on/off. (Currently only active if you define NUM_BUTTONS as 0)
Also, it was starting to feel cumbersome to not be able to have separate set of configurations for each saber, so I broke out most of the configuration stuff into a separate file, of which there are three right now. (One of each of my sabers.)
I've uploaded my changes to github and will upload to my site after some testing as usual.
I saw the toy saber and that is pretty sweet. Putting new life into something is always nice. That is interesting... So a couple quick twists to the left or right and it will turn on or off. That is pretty nice idea.

Breaking out the config files will greatly help is changing code. And make it easier for students to tailor the code for their saber set up. Nicely done :)

Regards,

GMcIvor

Offline BATMAnakin Skywalker

  • No Force
  • *
  • Posts: 17
  • Be careful not to choke on your aspirations.
    • Harris Maynard Portfolio
Re: TeensySaber Software Discussion
« Reply #49 on: June 13, 2017, 03:07:38 AM »
Wow, it's nice to see all the work you've done on this! I plan on making a teensysaber soon, as I've already got my blade made and a teensy I bought ages ago when I wanted to try making a saber with it, and then wanted to make one even more when I saw what you've done. The programming aspect sort of scares me away from finishing stuff like this, but I'm slowly getting there.

As for features that would be cool, I would want are bluetooth connectivity to a basic app for controlling the neopixels and typing in new parameters to the board from a phone. Also I think it would be amazing if there was something for controlling a power level indicator/accent LEDs/crystals- which leads me to my next thing: if you've got boards made (of which I'm interested in one of), I imagine the space saved is quite a bit, so that there would be room for a crystal chamber in this build now? I would love to take a crack at it if it can be done!

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #50 on: June 13, 2017, 09:02:05 AM »
Wow, it's nice to see all the work you've done on this! I plan on making a teensysaber soon, as I've already got my blade made and a teensy I bought ages ago when I wanted to try making a saber with it, and then wanted to make one even more when I saw what you've done. The programming aspect sort of scares me away from finishing stuff like this, but I'm slowly getting there.

The programming is not so bad, at least if you start with one of the existing lightsaber code bases for teensys.

Quote
As for features that would be cool, I would want are bluetooth connectivity to a basic app for controlling the neopixels and typing in new parameters to the board from a phone.

Probably the right way to do that is to get a bluetooth le chip and hook it up to the RX3/TX3 on the teensy. Right now, all the neopixel stuff is controlled by code, not by parameters, so that would take some work, but is totally doable though.

Quote
Also I think it would be amazing if there was something for controlling a power level indicator/accent LEDs/crystals- which leads me to my next thing: if you've got boards made (of which I'm interested in one of), I imagine the space saved is quite a bit, so that there would be room for a crystal chamber in this build now? I would love to take a crack at it if it can be done!
It does save a lot of space. There might be enough space for a crystal chamber, it depends on the hilt and your skill.

I have some teensysaber V2 boards for sale here: TeensySaber V2 for sale
The teensysaber V2 has room for three extra FETs on the bottom, which can be used to drive three accent LEDs (or one RGB led.)

A PLI indicator could be made in a few different ways. One way is to use a few small LEDs, another is to use a small neopixel strip, and finally, you could just hook up a small LCD, oled or e-ink display...

Basically I think everything you want is doable, but some is a lot more work than others... :)

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #51 on: June 14, 2017, 04:49:28 PM »

As for features that would be cool, I would want are bluetooth connectivity to a basic app for controlling the neopixels and typing in new parameters to the board from a phone.

Probably the right way to do that is to get a bluetooth le chip and hook it up to the RX3/TX3 on the teensy. Right now, all the neopixel stuff is controlled by code, not by parameters, so that would take some work, but is totally doable though.

A bluetooth board like this might work if you have enough space in the hilt:
SparkFun Bluetooth Mate Gold - WRL-12580 - SparkFun Electronics

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #52 on: June 14, 2017, 06:35:26 PM »
Just an idea for a slight change/improvement to the Teensy Saber software.  I think it would be great to have an option to use a double-tap of the "pow" or "aux" button (instead of a single press) to turn on and off the blade.  This would help avoid accidentally turning off (or on) the blade while handling the saber.

Let me know what you think.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #53 on: June 14, 2017, 07:11:45 PM »
Just an idea for a slight change/improvement to the Teensy Saber software.  I think it would be great to have an option to use a double-tap of the "pow" or "aux" button (instead of a single press) to turn on and off the blade.  This would help avoid accidentally turning off (or on) the blade while handling the saber.

Let me know what you think.

Might be a good idea, especially when using touchbuttons. Originally I didn't implement double-clicks because it would require a delay on single clicks, but if single clicks don't do anything, then that is not a problem...

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #54 on: June 15, 2017, 05:13:52 PM »
Just another quick question... There's no issue with shortening the LED strip blade by reducing the number of LEDs, correct?  All I would need to do is reflect the matching number of LEDs in the BladeConfig blades[] section, correct?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #55 on: June 15, 2017, 05:20:34 PM »
Just another quick question... There's no issue with shortening the LED strip blade by reducing the number of LEDs, correct?  All I would need to do is reflect the matching number of LEDs in the BladeConfig blades[] section, correct?

Correct.

Offline BATMAnakin Skywalker

  • No Force
  • *
  • Posts: 17
  • Be careful not to choke on your aspirations.
    • Harris Maynard Portfolio
Re: TeensySaber Software Discussion
« Reply #56 on: June 16, 2017, 02:28:36 AM »

As for features that would be cool, I would want are bluetooth connectivity to a basic app for controlling the neopixels and typing in new parameters to the board from a phone.

Probably the right way to do that is to get a bluetooth le chip and hook it up to the RX3/TX3 on the teensy. Right now, all the neopixel stuff is controlled by code, not by parameters, so that would take some work, but is totally doable though.

A bluetooth board like this might work if you have enough space in the hilt:
SparkFun Bluetooth Mate Gold - WRL-12580 - SparkFun Electronics


Awesome! I shall get one of these when I start the build.

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #57 on: June 16, 2017, 12:30:33 PM »
I wonder if there is a smaller version of this somewhere:

NeoPixel Stick - 8 x 5050 RGB LED with Integrated Drivers ID: 1426 - .95 :

It would make a wonderful PLI thingy if it wasn't quote so big.

Offline Obi-Ken Wanobi

  • No Force
  • *
  • Posts: 48
  • Help me Obi-Ken... you're my only hope.
Re: TeensySaber Software Discussion
« Reply #58 on: June 17, 2017, 06:46:22 PM »
I am trying to compile v1.119 for the Teensy 3.5 and I'm getting the following errors...

lightsaber-1.119.ino: In constructor 'TouchButton::TouchButton(int, int, const char*)':
lightsaber-1.119.ino:9473:9: error: 'pin2tsi' was not declared in this scope
     if (pin2tsi[pin_] == 255) {
         ^
lightsaber-1.119.ino: In member function 'virtual void TouchButton::Loop()':
lightsaber-1.119.ino:9522:22: error: 'pin2tsi' was not declared in this scope
         int32_t ch = pin2tsi[pin_];
                      ^
lightsaber-1.119.ino:9527:9: error: 'TSI0_GENCS' was not declared in this scope
         TSI0_GENCS = 0;
         ^
lightsaber-1.119.ino:9528:9: error: 'TSI0_PEN' was not declared in this scope
         TSI0_PEN = (1 << ch);
         ^
lightsaber-1.119.ino:9529:9: error: 'TSI0_SCANC' was not declared in this scope
         TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);
         ^
lightsaber-1.119.ino:9529:41: error: 'TSI_SCANC_REFCHRG' was not declared in this scope
         TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);
                                         ^
lightsaber-1.119.ino:9529:63: error: 'CURRENT' was not declared in this scope
         TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);
                                                               ^
lightsaber-1.119.ino:9529:70: error: 'TSI_SCANC_EXTCHRG' was not declared in this scope
         TSI0_SCANC = TSI_SCANC_REFCHRG(3) | TSI_SCANC_EXTCHRG(CURRENT);
                                                                      ^
lightsaber-1.119.ino:9530:37: error: 'NSCAN' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
                                     ^
lightsaber-1.119.ino:9530:42: error: 'TSI_GENCS_NSCN' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
lightsaber-1.119.ino:9530:59: error: 'PRESCALE' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
                                                           ^
lightsaber-1.119.ino:9530:67: error: 'TSI_GENCS_PS' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
                                                                   ^
lightsaber-1.119.ino:9530:71: error: 'TSI_GENCS_TSIEN' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
                                                                       ^
lightsaber-1.119.ino:9530:89: error: 'TSI_GENCS_SWTS' was not declared in this scope
         TSI0_GENCS = TSI_GENCS_NSCN(NSCAN) | TSI_GENCS_PS(PRESCALE) | TSI_GENCS_TSIEN | TSI_GENCS_SWTS;
                                                                                         ^
lightsaber-1.119.ino:9539:14: error: 'TSI0_GENCS' was not declared in this scope
       while (TSI0_GENCS & TSI_GENCS_SCNIP) YIELD();
              ^
lightsaber-1.119.ino:9539:27: error: 'TSI_GENCS_SCNIP' was not declared in this scope
       while (TSI0_GENCS & TSI_GENCS_SCNIP) YIELD();
                           ^
lightsaber-1.119.ino:9544:39: error: 'TSI0_CNTR1' was not declared in this scope
       Update(*((volatile uint16_t *)(&TSI0_CNTR1) + (pin2tsi[pin_])));
                                       ^
lightsaber-1.119.ino:9544:54: error: 'pin2tsi' was not declared in this scope
       Update(*((volatile uint16_t *)(&TSI0_CNTR1) + (pin2tsi[pin_])));
                                                      ^


The same code compiles fine when I select the Teensy 3.2 board. 

I haven't been able to figure out why.  Any ideas?

Offline profezzorn

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 901
  • May the source be with you.
    • Hubbe's Corner
Re: TeensySaber Software Discussion
« Reply #59 on: June 17, 2017, 07:40:08 PM »
I am trying to compile v1.119 for the Teensy 3.5 and I'm getting the following errors...

....

The same code compiles fine when I select the Teensy 3.2 board. 

I haven't been able to figure out why.  Any ideas?

The Teensy 3.5 doesn't support touch buttons, and it would seem my code doesn't like that.
I will fix it.

 

retrousse