Makecode upload problems

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
collene
 
Posts: 26
Joined: Thu Oct 05, 2017 8:38 pm

Makecode upload problems

Post by collene »

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

User avatar
meskdavi
 
Posts: 8
Joined: Wed Mar 15, 2017 10:34 am

Re: Makecode upload problems

Post by meskdavi »

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

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

Post by adafruit2 »

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!

User avatar
collene
 
Posts: 26
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

Post by collene »

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

Maybe another set of eyes can see something wrong!

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

Post by adafruit2 »

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?

User avatar
collene
 
Posts: 26
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

Post by collene »

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.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

Post by adafruit2 »

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!

User avatar
collene
 
Posts: 26
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

Post by collene »

The same thing happened when I used an anonymous window.

User avatar
AnneBarela
Learn User Page
 
Posts: 757
Joined: Sat Mar 24, 2012 8:56 pm

Re: Makecode upload problems

Post by AnneBarela »

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

User avatar
collene
 
Posts: 26
Joined: Thu Oct 05, 2017 8:38 pm

Re: Makecode upload problems

Post by collene »

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

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Makecode upload problems

Post by adafruit2 »

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

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

Re: Makecode upload problems

Post by AT_gur »

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.
BANNEDMessenger Hotstar

Locked
Please be positive and constructive with your questions and comments.

Return to “AdaBox! Show us what you made!”