Go to advanced search

by AeroFixerB1
Mon Jul 22, 2019 6:42 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

I have marked the positive on the diagram ( + ) is right next to the power supply, which means every thing connected to that point is positive. https://i.imgur.com/Y0WQNQV.jpg Thank you much! I know it was probably a super dumb question but i had to ask it as both the GPIO and the PSU are able to s...
by AeroFixerB1
Fri Jul 19, 2019 2:15 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

Ok so I think a small DC coreless motor is just a standard DC brushed motor ( correct me if I am wrong ) so you can probably dive it using a 2N2222 transistor just the same as I have, what ever you do, do not power the motor from the 3.3v pin on the pi gpio header use a separate psu. The pi gpio is...
by AeroFixerB1
Fri Jul 19, 2019 12:51 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

So I could go on editing this program forever but seeing as it really needs to be run on the actual hardware that's going to be used for the display, to allow it to be fine tuned to that motor / propeller I am going to stop. So this is the code I came up with , it may not be the right way to do it ...
by AeroFixerB1
Thu Jul 18, 2019 10:59 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

It might help if you told us what voltage you need for your motor, but assuming 5v and your motor being so small , if that's all its going to power then any 5V 1A power supply would do, depending how often its likely to run you could even use batteries, they might be a quick option for testing. I h...
by AeroFixerB1
Thu Jul 18, 2019 1:05 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

So kept playing with this and this is how far I have got with the information supplied so far. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(21, GPIO.IN, GPIO.PUD_UP) GPIO.setup(25, GPIO.OUT) GPIO.setup(20, GPIO.OUT) delay = 240 # number of seconds to...
by AeroFixerB1
Wed Jul 17, 2019 12:11 pm
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

Thank you so much for your help with this. But what is the PSU you mention? Also what if i wanted to start the strobe lets say, 60 seconds after the motor has started and then shut off say 30 seconds before the motor stops is that possible? My goal is to simulate that the pilot is turning the light...
by AeroFixerB1
Wed Jul 17, 2019 11:31 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

Ok so I think a small DC coreless motor is just a standard DC brushed motor ( correct me if I am wrong ) so you can probably dive it using a 2N2222 transistor just the same as I have, what ever you do, do not power the motor from the 3.3v pin on the pi gpio header use a separate psu. The pi gpio is...
by AeroFixerB1
Wed Jul 17, 2019 10:37 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

Yes. I feel it would be a lot easier to program everything into one program rather than have multiple programs going off one button push. Then it would help to know what gpio is being use for what device and how you are driving your motor , simple transistor or motor driver board ? I have been work...
by AeroFixerB1
Wed Jul 17, 2019 9:36 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

Do you want this strobe to flash and have the motor start / sound play ( from original post ) all in the one program , because if you do you can't do it like that, while you are starting the motor. Yes. I feel it would be a lot easier to program everything into one program rather than have multiple...
by AeroFixerB1
Wed Jul 17, 2019 8:49 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

My code is set up as follows:

Code: Select all

import time
import RPi.GPIO as GPIO
GPIO.setmode (GPIO.BCM)
GPIO.setup (4, GPIO.OUT)

for x in range (0,5)
	GPIO.output(4, True)
	time.sleep(0.06)
	GPIO.output(4, False)
	time.sleep(0.06)
	GPIO.output(4, True)
	time.sleep(0.06)
	GPIO.output(4, False)
	time.sleep(1)
	
by AeroFixerB1
Wed Jul 17, 2019 5:52 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Re: Timed loop?

jbeale wrote:
Wed Jul 17, 2019 5:24 am
It is certainly possible to run a program for <x> seconds and then stop and/or take some other action. I could give an example if you want but I'd need to know what language you are using- Bash shell script, Python, C/C++ or something else?
Im using Python
by AeroFixerB1
Wed Jul 17, 2019 4:53 am
Forum: Beginners
Topic: Timed loop?
Replies: 26
Views: 1250

Timed loop?

Is there a way to have a timed loop? Im using a Pi Zero to control a large scale diorama im making where when the program starts when a button is pressed i have the engine of the model aircraft start up with lights and sound. One of the lights on the aircraft is a strobe and after some experimenting...
by AeroFixerB1
Thu May 16, 2019 11:46 pm
Forum: Python
Topic: Can Someone Help Me Start My Program With A Button
Replies: 8
Views: 568

Re: Can Someone Help Me Start My Program With A Button

I guess what I need to know now is how to set up the code. I understand I'm going to need to set up a continuous loop and put in sleep times but i guess with me not being experienced at all with programing i don't how to set it up correctly. I feel the more videos i watch trying to learn how to set ...
by AeroFixerB1
Thu May 16, 2019 10:22 pm
Forum: Python
Topic: Can Someone Help Me Start My Program With A Button
Replies: 8
Views: 568

Re: Can Someone Help Me Start My Program With A Button

I guess I'm just really confused on how to make it do that. Does anyone know I good place to get some tutorials on how to set this program?
by AeroFixerB1
Thu May 16, 2019 2:42 am
Forum: Python
Topic: Can Someone Help Me Start My Program With A Button
Replies: 8
Views: 568

Can Someone Help Me Start My Program With A Button

Hello, I will first start off by saying I'm new to this thing and don't know a lot. This program is for a project I'm building. :? So to paint a picture of what I'm wanting to do, I am writing a program that will be for a diorama I'm making of a 1:32 model airplane. My idea is to have the engine sta...
by AeroFixerB1
Fri Mar 29, 2019 12:17 am
Forum: Beginners
Topic: Setting up a Start Program Button
Replies: 8
Views: 444

Re: Setting up a Start Program Button

I think what you actually need is to have your program running but wait for a button press to execute turning the motor and playing the engine sound. So the program would work like this. Program start Set up gpio for output for motor control Set up gpio for button input Check button status If not p...
by AeroFixerB1
Wed Mar 27, 2019 5:47 pm
Forum: Beginners
Topic: Setting up a Start Program Button
Replies: 8
Views: 444

Re: Setting up a Start Program Button

Welcome to the Raspberry Pi forums. The gpiozero Python library module installed by default with the Raspberry Pi Foundation Raspbian Stretch Operating System might be a good starting point. There is documentation for a simple Start/Stop button here: https://gpiozero.readthedocs.io/en/stable/recipe...
by AeroFixerB1
Wed Mar 27, 2019 5:44 pm
Forum: Beginners
Topic: Setting up a Start Program Button
Replies: 8
Views: 444

Re: Setting up a Start Program Button

klricks wrote:
Wed Mar 27, 2019 12:35 pm
A RPi Zero W does not have an audio output jack so in order to have audio you will need to have an HDMI TV/monitor attached.
I understand and ive already got a solution for that problem by getting a HAT from adafruit to allow me to attach speakers.
by AeroFixerB1
Wed Mar 27, 2019 3:44 am
Forum: Beginners
Topic: Setting up a Start Program Button
Replies: 8
Views: 444

Setting up a Start Program Button

Hello, I'm pretty new to this and I'm learning every step of the way. I'm using a Pi Zero W for a new project and my goal with the project is to have the Pi run a program for a Plastic scale model. My plan is to have the program simulate the engine starting in the plane by having the program turn a ...

Go to advanced search