Go to advanced search

by gordon77
Sun Dec 09, 2018 8:03 pm
Forum: General discussion
Topic: Very small relay?
Replies: 2
Views: 90

Re: Very small relay?

How about solid state? https://uk.farnell.com/clare/lca710/relay-solid-state-spst/dp/1653758?mckv=sCKim6sDa_dt|pcrid|77641111088|kword|lca710|match|p|plid||slid||product||pgrid|5280926288|ptaid|kwd-323298772485|&CMP=KNC-GUK-GEN-SKU-MDC&gclid=CjwKCAiAl7PgBRBWEiwAzFhmmlr1MWdoQkvJYuksRbVEbZmOd484aKvSoB...
by gordon77
Sun Dec 09, 2018 11:05 am
Forum: Advanced users
Topic: real/fake hwclock/ntp interaction
Replies: 1
Views: 41

Re: real/fake hwclock/ntp interaction

Here's what I did with my ds1307, l found it on this forum somewhere. add dtoverlay=i2c-rtc,ds1307 to /boot/config.txt in /lib/udev/hwclock-set put # in front of these lines if [-e /run/systemd/system ]; then exit fi and # in front of the 2 lines containing --systz reboot your pi set the clock with ...
by gordon77
Sat Dec 08, 2018 8:49 am
Forum: Automation, sensing and robotics
Topic: 4 Way Switch?
Replies: 1
Views: 72

Re: 4 Way Switch?

relays with crossed inputs.
by gordon77
Wed Dec 05, 2018 5:44 pm
Forum: Automation, sensing and robotics
Topic: Help: Automation Using GPS
Replies: 9
Views: 167

Re: Help: Automation Using GPS

I am using a robopi hat. I have written a bunch of messy code that doesn't work, so I decided to restart writing it. I do have a compass that I can implement. I am trying to get it done as soon as possible, because I am in a bit of a rush to get it done for my engineering class (10 days). I would u...
by gordon77
Wed Dec 05, 2018 12:40 pm
Forum: Automation, sensing and robotics
Topic: Help: Automation Using GPS
Replies: 9
Views: 167

Re: Help: Automation Using GPS

What have you written so far? What motor hat are you using?
by gordon77
Mon Dec 03, 2018 11:08 am
Forum: Camera board
Topic: Camera could not initialize when I set of a buzzer.
Replies: 2
Views: 80

Re: Camera could not initialize when I set of a buzzer.

I would assume 3 is the problem. You need an interface eg transistor to run the buzzer from 5v
by gordon77
Sun Dec 02, 2018 6:12 pm
Forum: Astro Pi
Topic: Calculating area covered by a photo from the Raspberry Pi Camera Module
Replies: 5
Views: 86

Re: Calculating area covered by a photo from the Raspberry Pi Camera Module

This site https://www.scantips.com/lights/fieldofview.html suggests the following... 494km x 370km.

Worth getting a second opinion!
by gordon77
Sun Dec 02, 2018 5:12 pm
Forum: Astro Pi
Topic: Calculating area covered by a photo from the Raspberry Pi Camera Module
Replies: 5
Views: 86

Re: Calculating area covered by a photo from the Raspberry Pi Camera Module

Here's the spec showing coverage angles, do you know the height of the iss?


https://www.raspberrypi.org/documentati ... re/camera/

V1 and V2 cameras
by gordon77
Sun Dec 02, 2018 10:09 am
Forum: General discussion
Topic: SimpleCV with Pi camera
Replies: 5
Views: 170

Re: SimpleCV with Pi camera

add import os at the beginning
by gordon77
Sat Dec 01, 2018 4:34 pm
Forum: General discussion
Topic: SimpleCV with Pi camera
Replies: 5
Views: 170

Re: SimpleCV with Pi camera

Add this near to the top of your script

Code: Select all

 # initialise pi camera v4l2
if not os.path.exists('/dev/video0'):
   rpistr = "sudo modprobe bcm2835-v4l2"
   p = subprocess.Popen(rpistr, shell=True, preexec_fn=os.setsid)
   time.sleep(1)  
And add import subprocess at the beginning.
by gordon77
Thu Nov 29, 2018 8:23 pm
Forum: General programming discussion
Topic: Picture frame project, managing files
Replies: 7
Views: 950

Re: Picture frame project, managing files

Shorter version... #!/usr/bin/env python3 import os import shutil dir_1 = "/home/pi/Pictures/" dir_2 = "/home/pi/Documents/" dir_3 = "/home/pi/Downloads/" dir_4 = "/home/pi/Templates/" # read list of dir_2 Files dir_2_File = [] dir_2_File = (os.listdir(dir_2)) for counter in range (0,len(dir_2_File)...
by gordon77
Thu Nov 29, 2018 9:59 am
Forum: Python
Topic: building a recognition machine with rpi3
Replies: 59
Views: 2585

Re: building a recognition machine with rpi3

I tried this code but it didn't work so I tried using imutils.resize in my script to see if it was faster but it was very slow. It takes upto 20 tries per template where as I take upto 5. Here' my modified code using imutils taking 10 tries.. #!/usr/bin/env python import cv2 import numpy as np impor...
by gordon77
Thu Nov 29, 2018 8:50 am
Forum: Python
Topic: Management of duplicate file names
Replies: 4
Views: 115

Re: Management of duplicate file names

Can be a bit shorter.. #!/usr/bin/env python3 import os import shutil dir_1 = "/home/pi/Pictures/" dir_2 = "/home/pi/Documents/" dir_3 = "/home/pi/Downloads/" dir_4 = "/home/pi/Templates/" # read list of dir_2 Files dir_2_File = [] dir_2_File = (os.listdir(dir_2)) for counter in range (0,len(dir_2_F...
by gordon77
Wed Nov 28, 2018 5:19 pm
Forum: Python
Topic: building a recognition machine with rpi3
Replies: 59
Views: 2585

Re: building a recognition machine with rpi3

It's better to post on here in Code boxes to keep indentation etc. Also there are some errors in it ? Where did it come from ?

I am not sure it will give any advantage over my script.
by gordon77
Wed Nov 28, 2018 3:55 pm
Forum: Python
Topic: Management of duplicate file names
Replies: 4
Views: 115

Re: Management of duplicate file names

I replied to your earlier thread... https://www.raspberrypi.org/forums/viewtopic.php?t=227443 #!/usr/bin/env python3 import os import shutil dir_1 = "/home/pi/Pictures/" dir_2 = "/home/pi/Documents/" dir_3 = "/home/pi/Downloads/" dir_4 = "/home/pi/Templates/" # read list of dir_2 Files dir_2_File = ...
by gordon77
Wed Nov 28, 2018 10:20 am
Forum: General programming discussion
Topic: Picture frame project, managing files
Replies: 7
Views: 950

Re: Picture frame project, managing files

Try this.. Backup any files first !! Change dir_1 etc as required #!/usr/bin/env python3 import os import shutil dir_1 = "/home/pi/Pictures/" dir_2 = "/home/pi/Documents/" dir_3 = "/home/pi/Downloads/" dir_4 = "/home/pi/Templates/" # read list of dir_2 Files dir_2_File = [] dir_2_File = (os.listdir(...
by gordon77
Wed Nov 28, 2018 8:52 am
Forum: Python
Topic: building a recognition machine with rpi3
Replies: 59
Views: 2585

Re: building a recognition machine with rpi3

I have used a multiscale technique above BUT you said you couldn't use .shape.

The code you show doesn't do multiscale as far as I can see.
by gordon77
Wed Nov 28, 2018 8:47 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

Try this. I believe callback doesn't cope with switch bounce. It assumes there are 2 detectors. 1 for the product, maybe an IR beam, shown in RED, which will detect 'good'. Then there is a METAL detector set slightly later, shown in BLUE. If this detects it will subtract 1 from good and add 1 to fau...
by gordon77
Tue Nov 27, 2018 3:44 pm
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

Upload your modified code, details of what switches you have connected and what you are switching to get the response.
by gordon77
Tue Nov 27, 2018 12:10 pm
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

No, never looked at sms.
by gordon77
Tue Nov 27, 2018 11:57 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

Try something like this... from tkinter import * import RPi.GPIO as GPIO import time """Setup the GPIO Pins""" GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(7,GPIO.IN) # METAL DETECTOR from pin 26 to gnd GPIO.setup(18,GPIO.IN) # PRODUCT DETECTOR from pin 12 to gnd GOODvar = 0 FAULTvar = ...
by gordon77
Tue Nov 27, 2018 11:49 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

This would be gpio 18, not 12.
Is this to simulate a 'good' product detector?
by gordon77
Tue Nov 27, 2018 11:19 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

Mine works with a switch (N/O) between pins 26 and 25 (gnd), or is this an additional switch ?

How have you connected the switch ?
by gordon77
Tue Nov 27, 2018 10:53 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

Fan174 wrote:
Tue Nov 27, 2018 10:50 am
gordon77 wrote:
Tue Nov 27, 2018 10:32 am
With one sensor and one GPIO I don't see how you can tell the difference between a 'good' item and no item.
So I can only count faulty product with metal detector.

If I want to count good product I have to use another sensor
yes. Maybe a pi camera, ultrasonic sensor, or IR beam ?
by gordon77
Tue Nov 27, 2018 10:32 am
Forum: Python
Topic: GUI with Python program
Replies: 30
Views: 710

Re: GUI with Python program

With one sensor and one GPIO I don't see how you can tell the difference between a 'good' item and no item.

Go to advanced search