Yes, just be careful to keep it neat and insulated so nothing else can accidentally touch it.
Dave
Question about the Powerboost part used with the fairy wings project
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
Awesome! Fingers crossed this is it lok
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
Everything seems to be powered up now but I seem to be having the same problem as the last pair I made. You and I went through all the solder points to discover that the code I was using was outdated. Would you be willing to check the code for me? I have a green light on the M4 that will blink green once then pause and blink once again, which is exactly what the last pair was doing. It is the code from the project bundle but things seem to have been updated in there since we made the last pair.
This is the code
This is the code
Code: Select all
# SPDX-FileCopyrightText: 2021 Erin St Blaine for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
Fluttering Fairy Wings
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Adafruit!
Written by Erin St Blaine for Adafruit Industries
Copyright (c) 2020-2021 Adafruit Industries
Licensed under the MIT license.
All text above must be included in any redistribution.
"""
import time
import random
import board
from analogio import AnalogIn
from adafruit_servokit import ServoKit
analog_in = AnalogIn(board.A0)
kit = ServoKit(channels=8)
SERVO_MIN = 0
SERVO_MAX = 130
DELAY_MIN = 0.01 # In seconds, is the longest DELAY between servo moves
DELAY_MAX = 0.1 # In seconds, is the longest DELAY between servo moves
DELAY = DELAY_MAX
def set_delay():
'''calibrate to potentiometer'''
global DELAY # pylint: disable=global-statement
DELAY = DELAY_MIN + DELAY_MAX * (65535 - analog_in.value) / 65535
#print(DELAY\
while True:
num_flaps = random.randint(1, 4)
print("Flapping", num_flaps, "times")
for flap in range(num_flaps):
print("Open")
set_delay()
for angle in range(SERVO_MIN, SERVO_MAX, 2): # move 2 deg at a time
kit.servo[0].angle = angle
kit.servo[1].angle = SERVO_MAX-angle
time.sleep(DELAY)
print("Close")
set_delay()
for angle in range(SERVO_MIN, SERVO_MAX, 2): # move 2 deg at a time
kit.servo[0].angle = SERVO_MAX-angle
kit.servo[1].angle = angle
time.sleep(DELAY*2)
print("Waiting...")
time.sleep(random.randint(2, 10)) # wait 2 to 10 seconds
Last edited by dastels on Thu Aug 25, 2022 1:37 pm, edited 1 time in total.
Reason: Add code tag
Reason: Add code tag
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
First make sure you have CircuitPython 7.3.2 and the latest 7.x library bundle.
Can you run it with USB connected to see what's sent to the REPL? That will give a better indication on what's happening.
Dave
Can you run it with USB connected to see what's sent to the REPL? That will give a better indication on what's happening.
Dave
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
Ok here is what I get when I send it to REPL:
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.3.2 on 2022-07-20; Adafruit Feather M4 Express with samd51j19
>>> print("Hello, CircuitPython!")
Hello, CircuitPython!
>>>
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 7.3.2 on 2022-07-20; Adafruit Feather M4 Express with samd51j19
>>> print("Hello, CircuitPython!")
Hello, CircuitPython!
>>>
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
What about when you run the servo code?
Dave
Dave
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
So when I connect MU to my board they only other code I see is _init_.py. when I load that it just comes up with a blank screen.
When I open CIRCUITPY in my files I can see adafruit_pca9685.mpy and adafruit_servokit.mpy but neither of those show in MU
When I open CIRCUITPY in my files I can see adafruit_pca9685.mpy and adafruit_servokit.mpy but neither of those show in MU
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
They won't show up in MU since they are library files. They should in in CIRCUITPY/lib btw.
code.py should be in CIRCUITPY.
Dave
code.py should be in CIRCUITPY.
Dave
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
Code.py is and thats what I ran...Unless I ran it wrong
- michaelmeissner
- Posts: 1822
- Joined: Wed Aug 29, 2012 12:40 am
Re: Question about the Powerboost part used with the fairy wings project
In general, yes you can do this (and it isn't a stupid question BTW). In more complex setups, there might be reasons why you don't want to connect all of the ground wires to a single connection on the microprocessors.Froggy92030 wrote: ↑Thu Aug 25, 2022 12:35 pm This may be a stupid question but can I splice all 3 ground wires together and attach them to the end of a single wire that is then soldered to the ground pin?
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
I see calls to print in the code so you should see that output in the REPL.
Dave
Dave
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
So would I be checking the spots that say
print("flapping", num_flaps, "times") or anything that has the print command before it?
print("flapping", num_flaps, "times") or anything that has the print command before it?
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
Exactly. You should see that output in the REPL. Double check that CIRCUITPY/code.py has the expected code in it.
Dave
Dave
- Froggy92030
- Posts: 97
- Joined: Wed Apr 20, 2022 8:25 pm
Re: Question about the Powerboost part used with the fairy wings project
How would I see it in REPL? This is probably where I am missing a step. I know how to get into REPL, and how to access the help modules, and see what pins are available on the board.
- dastels
- Posts: 15667
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Question about the Powerboost part used with the fairy wings project
Anything output using print is sent to the REPL. Any error that causes the code to crash/stop is output to the REPL in a fair amount of detail.
Dave
Dave
Please be positive and constructive with your questions and comments.