0

NeoPixels and small Servo not working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixels and small Servo not working

by criddy on Tue Aug 13, 2019 1:01 am

Hello everyone,

I am trying to run a small Servo and Neopixels on my Playground express. The problem I Keep running into is when I hook them both up they do not work, but if I have just the Neopixels or the servo alone they work. Can the playground express not handle them both?

Here is the code I am using.

let strip: light.NeoPixelStrip = null
forever(function () {
strip = light.createStrip(pins.A1, 12)
strip.setAll(0x00ff00)
light.setAll(0x00ff00)
for (let i = 0; i < 12; i++) {
strip.photonForward(1)
pause(100)
}
})

criddy
 
Posts: 8
Joined: Tue Dec 18, 2018 3:45 pm

Re: NeoPixels and small Servo not working

by criddy on Tue Aug 13, 2019 1:03 am

Wrong code sorry. Here is the correct 1

let strip: light.NeoPixelStrip = null
forever(function () {
strip = light.createStrip(pins.A1, 12)
strip.setAll(0x00ff00)
light.setAll(0x00ff00)
for (let i = 0; i < 12; i++) {
strip.photonForward(1)
pause(100)
}
while (true) {
servos.A1.run(50)
}
})

criddy
 
Posts: 8
Joined: Tue Dec 18, 2018 3:45 pm

Re: NeoPixels and small Servo not working

by nickine9 on Tue Aug 13, 2019 3:34 am

how are you powering the pixels and servo? there might not be enough power for them when powered the cpx. you could try a separate power connection for the servo.

nickine9
 
Posts: 118
Joined: Fri Jan 06, 2017 4:14 am

Re: NeoPixels and small Servo not working

by criddy on Tue Aug 13, 2019 5:12 am

I just found the info on this. Looks like with the playground express it can not run neopixels and servos together...Sad day

criddy
 
Posts: 8
Joined: Tue Dec 18, 2018 3:45 pm

Re: NeoPixels and small Servo not working

by nickine9 on Tue Aug 13, 2019 8:16 am

I have used both an external ring and servo at the sometime with the cpx but i powered them from a battery rather than the cpx. you need to connect all the grounds together but it should work.

nick

nickine9
 
Posts: 118
Joined: Fri Jan 06, 2017 4:14 am

Re: NeoPixels and small Servo not working

by criddy on Wed Aug 14, 2019 4:09 am

Hello Nick,

I tried to used 12v of power leading to the PGE and still a no go. I think it has something to do with how the code works in PGE. Here is an article I found on it. If you found a workaround and can explain it to me without using another chip let me know.

https://learn.adafruit.com/neopixels-an ... s/overview

criddy
 
Posts: 8
Joined: Tue Dec 18, 2018 3:45 pm

Re: NeoPixels and small Servo not working

by nickine9 on Wed Aug 14, 2019 6:53 am

hi criddy,

I'm sorry it didn't click before but it looks like you are using the arduino ide, i have used the arduino ide for neopixels and servos but not with the CPX.

you can though use the makecode.org block programming language (which also allows you to use javascript). I dug out an old CPX, 16 neopixel ring and a small servo and got them working together with makecode with both the ring and servo powered from 4*AA batteries. it can be a bit tricky to synchronise servo movement with flashing lights but it can be used for simple projects.

hope that helps

nick

nickine9
 
Posts: 118
Joined: Fri Jan 06, 2017 4:14 am

Please be positive and constructive with your questions and comments.