0

Makecode upload problems
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Makecode upload problems

by collene on Thu Jul 19, 2018 11:45 pm

Hi all,

I'm making the project "collapsible house" for adabox 008. If I download the file from the example (https://makecode.adafruit.com/40594-27390-43309-80217 ) and upload it to the cpx, the servo works and the house collapses. However, if I go to https://makecode.adafruit.com/#editor and create the exact same script and upload that one, the servo never works. I've even compared the JS code in both versions -- the code is identical.

I did the setup for makecode to add the crickit extension (as outlined here: https://learn.adafruit.com/adafruit-cri ... -extension .

I did notice that even though the scripts were identical, the one I downloaded from the example had a larger file size (281 KB) than the one I created myself (279 KB).

Am I missing something in the makecode configuration?

Thanks,
~Collene

collene
 
Posts: 13
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

by meskdavi on Fri Jul 20, 2018 1:18 am

I don't have mine yet but maybe you need the servo extension as well, just a thought

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

Re: Makecode upload problems

by adafruit2 on Fri Jul 20, 2018 10:41 pm

collene, we tried that demo code and yeah it works fine so maybe when you redid it you skipped a part? post up a link to your shared makecode project and we can take a look!

adafruit2
Site Admin
 
Posts: 18047
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

by collene on Sun Jul 22, 2018 5:47 pm

Here's a link to my project: https://makecode.com/_31xdoX8zjPop

Maybe another set of eyes can see something wrong!

collene
 
Posts: 13
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

by adafruit2 on Sun Jul 22, 2018 6:11 pm

huh it looks the same - thats odd it doesnt work, can you make changes to our version if you need? do you get neopixels lighting up?

adafruit2
Site Admin
 
Posts: 18047
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

by collene on Sun Jul 22, 2018 6:54 pm

I can download your version and it works ok. I did notice that when I downloaded your version and used it, that the neopixels didn't light up as soon as I finished the upload...I had to unplug it from the computer, then turn on the crickit. Then the servo kicked in, collapsed the house, waited 2 seconds, uncollapsed the house, and I could blow on it to make it happen again. The neopixels worked as expected, graphing by sound level.

When I used my version, the neopixels lit up right after I uploaded it to the cpx. I still unplugged it from the computer, and then turned on the crickit. The neopixels lit up again, and worked like they did with your version. Just the servo never collapses the house.

Is there a version difference in the download between the version you used to make your version and mine? Like I mentioned in my original post, the file size of the downloaded uf2 is different, even though the program is the same.

collene
 
Posts: 13
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

by adafruit2 on Sun Jul 22, 2018 7:04 pm

can you try your program in a 'anonymous' window on your browser? that way it will not be saving anything that could be an old version. not sure what else to say its definitely unusual!

adafruit2
Site Admin
 
Posts: 18047
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

by collene on Mon Jul 23, 2018 8:21 pm

The same thing happened when I used an anonymous window.

collene
 
Posts: 13
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

by MikeBarela on Mon Jul 23, 2018 10:04 pm

Hi Collene, I have looked at this for Adafruit.

The code uses the pulse width to turn from 0 degrees to 180 degrees and back again. We've read some on the web that manufacturers are making their products with varying pulse constraints. I therefore changed it to angles. They might not be exact depending on the servo but it works: https://makecode.com/_FswKz4grbHsh

The Wood House threshold seemed really strong, I could not blow that house down. I think the guide says to change the sound thresholds if they are too soft or loud for your project.

Hopefully this code will get you back on track - we may alter the guide if you & others are having pulse issues and we decide to use angles.

Mike

MikeBarela
 
Posts: 715
Joined: Sat Mar 24, 2012 8:56 pm
Location: Mid-Atlantic

Re: Makecode upload problems

by collene on Sun Jul 29, 2018 11:39 pm

Hi Mike,

When I switched it to use angles, then the servo worked. It doesn't collapse the house (it only went about half way), but at least the servo works now. I can adjust it a bit to see if I can get the house to fully collapse.

Thanks for your help!
~Collene

collene
 
Posts: 13
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

by adafruit2 on Mon Jul 30, 2018 12:06 am

yay! please try, if you still have an issue, post again!

adafruit2
Site Admin
 
Posts: 18047
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

by AT_gur on Sun Aug 12, 2018 2:52 pm

Hi there,
Beside the Servo, you can focus on the pulse angle issue, there many industrial manifacturer using dynamic or varing pulse inputs, I found many interesting details while surfing and searching for program like that could work and give you additional alternatives for your problem.
WhatsappMessenger Hotstar

AT_gur
 
Posts: 1
Joined: Sun Aug 12, 2018 2:35 pm

Please be positive and constructive with your questions and comments.