CPE+Crickit - motor rotation
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
CPE+Crickit - motor rotation
My students are building a robot with CPE as the brains and Crickit as a driver for two hobby motors at 5V. The programming is done in Makecode with blocks. The task is to have the robot move forward, and then under certain conditions spin in place to change directions. They use the Neopixels to monitor the state of the program.
A group is using the "cricket tank motors (-50%) (50%) command, but the motors keep spinning in the same (+) direction. LEDs indicate that the robot is in the spin state, and in other steps of the program the motors did run backwards as expected. Any ideas what might be going on? -- Thanks for any help
A group is using the "cricket tank motors (-50%) (50%) command, but the motors keep spinning in the same (+) direction. LEDs indicate that the robot is in the spin state, and in other steps of the program the motors did run backwards as expected. Any ideas what might be going on? -- Thanks for any help
- Franklin97355
- Posts: 24401
- Joined: Mon Apr 21, 2008 2:33 pm
Re: CPE+Crickit - motor rotation
Not using Makecode I don't know if it is possible to post your code but it would help if you can.
- adafruit_support_bill
- Posts: 89646
- Joined: Sat Feb 07, 2009 10:11 am
Re: CPE+Crickit - motor rotation
Do you have one of your motors set to 'invert' the rotation direction?
https://learn.adafruit.com/adafruit-cri ... ed-2989460

https://learn.adafruit.com/adafruit-cri ... ed-2989460

- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
Re: CPE+Crickit - motor rotation
Thanks for the suggestion. No, we haven't tried that yet. I thought that block was mainly to make up for hardware confusion when the wiring went wrong. I'll pass it on, and we'll see what comes of itadafruit_support_bill wrote: Tue May 14, 2024 5:18 am Do you have one of your motors set to 'invert' the rotation direction?
https://learn.adafruit.com/adafruit-cri ... ed-2989460
![]()
- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
Re: CPE+Crickit - motor rotation
Here's the screenshot with the code. The bit in question is after the LEDs at 2 and 7 are turned red and greenFranklin97355 wrote: Mon May 13, 2024 5:33 pm Not using Makecode I don't know if it is possible to post your code but it would help if you can.

- Attachments
-
- screenshot of the code in question
- robotcode.png (101.63 KiB) Viewed 613 times
- adafruit_support_bill
- Posts: 89646
- Joined: Sat Feb 07, 2009 10:11 am
Re: CPE+Crickit - motor rotation
What do the motors do when both lights are green?
- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
Re: CPE+Crickit - motor rotation
Sorry for the follow-up, but here is a screen shot of the program from my student. (-100, -100) and (100, 100) do what is expected, but the (-100,100) keeps going straight with both wheels going forward instead of turning. Do you have any idea what went wrong? We are going to try Motor 1 (-100%), Motor 2 (100%) in separate commands tomorrow, as well as Motor 1 (0%), Motor 2 (100%). Do you have any other suggestions?adafruit_support_bill wrote: Tue May 14, 2024 5:18 am Do you have one of your motors set to 'invert' the rotation direction?
https://learn.adafruit.com/adafruit-cri ... ed-2989460
![]()
- adafruit_support_bill
- Posts: 89646
- Joined: Sat Feb 07, 2009 10:11 am
Re: CPE+Crickit - motor rotation
What do the motors do when both lights are green?
- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
Re: CPE+Crickit - motor rotation
They move both in the same direction, as intendedadafruit_support_bill wrote: Wed May 15, 2024 8:06 am What do the motors do when both lights are green?
- adafruit_support_bill
- Posts: 89646
- Joined: Sat Feb 07, 2009 10:11 am
Re: CPE+Crickit - motor rotation
I'll have one of our MakeCode experts take a look.
- rpeteranderl
- Posts: 7
- Joined: Thu May 28, 2015 1:44 pm
Re: CPE+Crickit - motor rotation
Thanks so much! In my next class with that team today I will have a look at the Java version of their program to see if anything sticks out to me (although I know next to nothing about Java...)adafruit_support_bill wrote: Wed May 15, 2024 1:25 pm I'll have one of our MakeCode experts take a look.
- adafruit2
- Posts: 22792
- Joined: Fri Mar 11, 2005 7:36 pm
Re: CPE+Crickit - motor rotation
ok lets try just a simple app with a single block so we can be sure that we're testing just one thing. in case the 100-ness is causing an issue, can you try just setting the motors to +50/-50?
Please be positive and constructive with your questions and comments.