Go Down

Topic: Arduino Lightsaber for/with LED string blade (Read 15858 times) previous topic - next topic

JakeSoft

#375
Apr 21, 2016, 03:10 am Last Edit: Apr 21, 2016, 03:15 am by JakeSoft
I did this a little while ago because I was trying to help @772pilot use my soft PWM library with LightSaberOS and I don't have Eclipse installed. To make it compile with Arduino IDE 1.6.6 and later you only need to change the filename of Lightsaber.ino to match the folder name and move(not copy!) the libraries to the libraries folder in your sketchbook folder. I just posted it on GitHub in case it might be of interest to anyone. The changes I made are shown at: https://github.com/per1234/LightSaberOS/commit/0a13827be9096ade53728921bb7489aebea63f7f
So to use it:

I changed the library include paths so that you don't need to do any extra steps to install the libraries but that's not necessary, it just makes installation easier and avoids any conflicts with previously installed libraries. I think if you're going to make an Arduino project available to the public it's only common sense to make it compatible with the Arduino IDE. I agree that this will make LightSaberOS more accessible. I don't own a light saber so I can't test this on the hardware but it does compile with Arduino IDE 1.6.6, 1.6.7, 1.6.8, and the hourly build. I haven't tested if this breaks Eclipse compatibility but I don't see any reason why it would. The Eclipse installation process would be different(more simple) since the libraries don't need to be installed.

I'm happy to add Arduino IDE install instructions to the readme and submit a pull request for this change to the LightSaberOS repository if neskweek wants me to.
Well, would you look at that? Ask and you shall receive! I continue to be impressed by the helpfulness and capabilities of the community members here on the Arduino forums. Thank you!

Protonerd

I did this a little while ago because I was trying to help @772pilot use my soft PWM library with LightSaberOS and I don't have Eclipse installed. To make it compile with Arduino IDE 1.6.6 and later you only need to change the filename of Lightsaber.ino to match the folder name and move(not copy!) the libraries to the libraries folder in your sketchbook folder. I just posted it on GitHub in case it might be of interest to anyone. The changes I made are shown at: https://github.com/per1234/LightSaberOS/commit/0a13827be9096ade53728921bb7489aebea63f7f
Impressive, I will give it a go as soon as I get near my workbench!!! Thanks a lot, that is a great contribution, I never stop to be amazed by this community.

neskweek

Wonderfull job Pert !

I'll test your changes as soon as I can to make them go mainstream.

Changes to readme are welcome too ;)

Thank you very much

pert

It was bothering me that LightSaberOS still wouldn't compile in Arduino IDE versions previous to 1.6.6. Many users have not wanted to upgrade past 1.6.5-r5 due to some bugs and breakage caused by changes made in 1.6.6. So I made the changes required to make LightSaberOS compatible with the older versions, shown at https://github.com/neskweek/LightSaberOS/compare/master...per1234:all-Arduino-IDE-compatibility. Unfortunately Arduino IDE versions previous to 1.6.6 don't support using libraries in subfolders of the sketch folder so to use this version of LightSaberOS with the Arduino IDE:
  • Download https://github.com/per1234/LightSaberOS/archive/all-Arduino-IDE-compatibility.zip
  • Unzip
  • Rename the folder LightSaberOS-all-Arduino-IDE-compatibility to LightSaberOS
  • Move(copy will cause compile to fail with IDE versions >=1.6.7) all subfolders of LightSaberOS/Libraries to {sketchbook folder}/libraries. To find your sketchbook folder location check File > Properties > Sketchbook location
  • Open the file LightSaberOS.ino in the Arduino IDE

I was able to compile with all Arduino IDE versions from 1.6.0-1.6.8 and the hourly build except for 1.6.4 which hung on compilation. This is a known issue with 1.6.4(not a LightSaberOS specific problem) and your results may vary. I didn't test Arduino IDE 1.5.x. LightSaberOS still doesn't compile with Arduino IDE 1.0.6, this could probably be fixed but I don't know how many people are still using the 1.0.x versions. As before, I haven't tested on hardware or with Eclipse.

I think it's unfortunate to lose the ability to use the libraries in place with Arduino IDE 1.6.6 and later as I had it set up in the version of LightSaberOS I posted previously. This could be worked around, for example:
Code: [Select]
#if ARDUINO > 10605
#include "Libraries/DFPlayer.h"
#else
#include <DFPlayer.h>
#endif

The downsides to this is that it will require different installation instructions depending on the IDE version.

I'm open to any feedback on these changes and am happy to submit a pull request.

Soulbp

Any one wire this up with a pro mini? Looking at the nano wiring diagram it seems odd because when I look at an online nano pin out the seem off. I thought I had it converted over but I guess no as my IMU doesn't initialize nor dfplayer

JakeSoft

Any one wire this up with a pro mini? Looking at the nano wiring diagram it seems odd because when I look at an online nano pin out the seem off. I thought I had it converted over but I guess no as my IMU doesn't initialize nor dfplayer
I haven't tried it myself, but it would be strange if it worked on a Nano but not a 5V pro mini since the pro mini is basically the Nano minus the FTDI chip for USB programming.

Protonerd

I was able to compile with all Arduino IDE versions from 1.6.0-1.6.8 and the hourly build except for 1.6.4 which hung on compilation. This is a known issue with 1.6.4(not a LightSaberOS specific problem) and your results may vary. I didn't test Arduino IDE 1.5.x. LightSaberOS still doesn't compile with Arduino IDE 1.0.6, this could probably be fixed but I don't know how many people are still using the 1.0.x versions. As before, I haven't tested on hardware or with Eclipse.


I'm open to any feedback on these changes and am happy to submit a pull request.
Pert, I indepted to you! It even compiles on 1.6.4 which I have! Simply excellent, now finally I can use LSOS v1.0!!! I still want to use Eclipse too, but now I'm not in a hurry any more.

JakeSoft

Pert, I indepted to you! It even compiles on 1.6.4 which I have! Simply excellent, now finally I can use LSOS v1.0!!! I still want to use Eclipse too, but now I'm not in a hurry any more.
Yeah, if all you want to do is compile somebody else's sketch and upload it to an MCU, the Arduino IDE is the way to go for simplicity. Eclipse is just much nicer tool if you plan to write a lot of new code.

Soulbp

I haven't tried it myself, but it would be strange if it worked on a Nano but not a 5V pro mini since the pro mini is basically the Nano minus the FTDI chip for USB programming.
Yes, the issue is the pin layout is different, and there are some mildly confusing things on the github diagram such as using the USB 3.3 to power one of the chips. The nanos pin layout and promo minis is close but not exact annoyingly the pro mini a4 and a5 are inset so they are not bread board friendly for example but they are needed for the 6050.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy