0

Light saber code problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Light saber code problems

by meskdavi on Tue Oct 02, 2018 3:14 pm

When I do check in MU it shows several errors. Most seem to be just typos, the ones I think may be a problem are line 24 says it's too long 83 instead of 79 characters and the excepts are marked with a bare exception. Now for the later I see the commented out line, when un-commented it returned it's own error and I assume it needs to be moved because it triggered errors on the imports. As to line 24 not sure how to fix that not really familiar with python, is it unimportant , shorten variable names or is their a shorter boolean argument option

When I tried the code mostly as is (added spaces before and after #'s where needed) I just get a pulsing green neopixel on the hallowing and had to reload spookify.uf2 to get it working again

meskdavi
 
Posts: 7
Joined: Wed Mar 15, 2017 10:34 am

Re: Light saber code problems

by johnpark on Thu Oct 04, 2018 11:49 am

Sorry you're having problems getting the code to run. None of those suggestions that Mu produces during the check matter as far as the code working, they are stylistic choices that are fine to ignore. We run a different series of checks on our code and allow different things to pass, for example, lines can be 120 characters instead of the 80 suggested by Mu.

The best thing to do if you are getting errors (the blinking NeoPixel on the HalloWing is indicating something wrong with the code) is to look at the serial console. If you're not familiar with using a serial console with HalloWing, check this out: https://learn.adafruit.com/welcome-to-c ... al-console and the REPL page https://learn.adafruit.com/welcome-to-c ... n/the-repl
You'll need to use something like Screen on the mac or PuTTY on Windows, as Mu won't show the REPL/Serial console for HalloWing the way it does for other boards (CPX, Feather M0 Express, etc.)

I'm guessing there's either some errant typo in the code on your board or a missing library/mismatched library to CircuitPython version. The serial console will help you see what's causing the problem.

johnpark
 
Posts: 367
Joined: Wed Mar 25, 2009 2:15 pm

Please be positive and constructive with your questions and comments.