Go to advanced search

by Ghwana
Thu Oct 04, 2018 12:03 pm
Forum: Beginners
Topic: Install python 2.7.3
Replies: 5
Views: 2883

Re: Install python 2.7.3

Thank you all, went with program menu and reinstated it, all working ok.
by Ghwana
Thu Oct 04, 2018 11:24 am
Forum: Beginners
Topic: Install python 2.7.3
Replies: 5
Views: 2883

Re: Install python 2.7.3

I've got this python code that was writen in 2.7.3, how can I convert it to python 3, please see below. #!/usr/bin/python import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # init list with pin numbers pinList = [4,17] # loop through pins and set mode and state to 'low' for i in pinList: GPI...
by Ghwana
Thu Oct 04, 2018 11:22 am
Forum: Beginners
Topic: Install python 2.7.3
Replies: 5
Views: 2883

Install python 2.7.3

Hi All, I've just updated my RPI 3B and python 2.7.3 has dissapeared, any idea how to reinstall it, currently on raspbian 9 (stretch)?
by Ghwana
Tue Jun 12, 2018 8:25 am
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Hi, this is working perfectly, thank you for all your help, please see finished code below for anyone that wants to use it. This works perfectly off a Zero W, no issues at all. import time from time import sleep from picamera import PiCamera import RPi.GPIO as GPIO GPIO.setmode (GPIO.BCM) GPIO.setwa...
by Ghwana
Mon Jun 11, 2018 3:32 pm
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Hi, I've resolved the switch issue now, I just need help rotating the image by 180 deg.
by Ghwana
Mon Jun 11, 2018 11:13 am
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Hi, please see image below, by clicking on link, as you can see the switch is over grd and gpio18. I also need to rotate the image 180 degrees. https://drive.google.com/file/d/1HNobInHO-ldWw5ZRbooRedKNW-cTWcyi/view?usp=sharing Have some code, but not sure how this would fit into the existing code. r...
by Ghwana
Wed Jun 06, 2018 2:59 pm
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Hi, I've modified the code slightly, as there were some errors, and I'm getting images going to the USB as jpg files which is great, but it does not matter if the switch is on or off, it still takes images every 3 seconds, I need to only take image when the switch is on. What am I doing wrong? Pleas...
by Ghwana
Fri Jun 01, 2018 3:14 pm
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Thank you for your help, I'll try this and post my findings for others to use, if all goes well.
Cheers Ghwana
by Ghwana
Fri Jun 01, 2018 2:44 pm
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Re: Multiple picam images on usb stick

Thank you, is there any way I can put this into a loop and have multiple images? It will be triggered with a switch, the code for the switch is easy, I just need multiple images.
by Ghwana
Fri Jun 01, 2018 1:16 pm
Forum: Beginners
Topic: Multiple picam images on usb stick
Replies: 10
Views: 501

Multiple picam images on usb stick

Hi All I'm struggling a little, please see py code below, I can send a single image to my USB on my RPi, but not multiple, what am I doing wrong? from time import sleep from picamera import PiCamera camera = PiCamera() camera.resolution = (620, 480) camera.start_preview() # Camera warm-up time sleep...
by Ghwana
Mon May 21, 2018 11:34 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Hi, all resolved, it's slowly starting to sink in, here is the finished copy for anyone wanting to use this in the future, thanks to all who helped with the process, please see finished copy below. :) #!/usr/bin/python import spidev import RPi.GPIO as GPIO import time from datetime import datetime i...
by Ghwana
Mon May 21, 2018 10:56 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

It looks like I have resolved this, please see code below, the only problem now is the it only prints values on 1 line on spreadsheet over and over again, how do I get to print on different rows, columns are OK, prints on terminal perfectly and switch working perfectly. I must be missing something, ...
by Ghwana
Mon May 21, 2018 10:26 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Hi, I've tried that and keeps getting this error, please see below: Python 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516] on linux2 Type "copyright", "credits" or "license()" for more information. >>> ===================== RESTART: /home/pi/SmartShelfIR.py ===================== Reading...
by Ghwana
Mon May 21, 2018 9:07 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Thank you much appreciated, will try that today. :)
by Ghwana
Fri May 18, 2018 12:10 pm
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Thank you for your support, appreciated.
by Ghwana
Fri May 18, 2018 11:02 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

I'm not very familiar with Python, its supposed to be the easiest code to write, but I'm trying to get my head around it, maybe I should have put this discussion in the beginner chat, not troubleshoot chat. :oops:
by Ghwana
Fri May 18, 2018 10:55 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Pcmanbob very kindly helped me with this on the Ultrasonic sensors, see script below, I just want to replace the ultrasonic sensors with the data coming from the MCP3008 chip and I'm struggling to do this, I don't know what I'm doing wrong, please see pcmanbob's code below: #!/usr/bin/python import ...
by Ghwana
Fri May 18, 2018 10:41 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

It doesn't like values.
by Ghwana
Fri May 18, 2018 10:36 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

OK, so please see amended code below: #!/usr/bin/python import spidev import RPi.GPIO as GPIO import time import os # GPIO setup GPIO.setmode (GPIO.BCM) GPIO.setwarnings(False) switch = 18 GPIO.setup(switch, GPIO.IN) #Define Variables delay = 0.5 #Create SPI spi = spidev.SpiDev() spi.open(0, 0) spi....
by Ghwana
Fri May 18, 2018 10:28 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Sorry, when switch is on data is sent to csv file, when switch is off, data stops being sent to csv file.
by Ghwana
Fri May 18, 2018 9:58 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

Re: MCP 3008 Chip sending data to CSV file via switch

Hi, I just want the adc channel values to be showing on RPi and sent to csv through switch, I'm not sure how to set a loop, I thought the loop had already been set, in code below: # Main program loop. while True: # Read all the ADC channel values in a list. values = [0]*8 for i in range(8): # The re...
by Ghwana
Thu May 17, 2018 2:19 pm
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 794

MCP 3008 Chip sending data to CSV file via switch

Hi, I'm trying to send data from RPi via MCP3008 chip, but keep getting error in code, please see code below, not sure where I've gone wrong! #!/usr/bin/python import spidev import RPi.GPIO as GPIO import time import os # GPIO setup GPIO.setmode (GPIO.BCM) GPIO.setwarnings(False) switch = 18 GPIO.se...
by Ghwana
Wed May 16, 2018 2:18 pm
Forum: Troubleshooting
Topic: MCP3008 Chip and Sharp ir distance sensor
Replies: 29
Views: 2092

Re: MCP3008 Chip and Sharp ir distance sensor

Hi, its all sorted, changed voltage from 5v to 3v feeding the sensors and everything is OK, go figure, sensors are rated upto 7v, not sure why they don't like 5v when all together!!
by Ghwana
Wed May 16, 2018 1:56 pm
Forum: Troubleshooting
Topic: MCP3008 Chip and Sharp ir distance sensor
Replies: 29
Views: 2092

Re: MCP3008 Chip and Sharp ir distance sensor

Hi , I'm currently running 7 sharp GP2Y0A41SK0F distance sensors that have all been tested and they all work OK. I'm using a MCP3008 chip and using this script below. #!/usr/bin/python import spidev import time #Define Variables delay = 0.5 #Create SPI spi = spidev.SpiDev() spi.open(0, 0) spi.max_sp...
by Ghwana
Thu Apr 26, 2018 8:09 am
Forum: Troubleshooting
Topic: MCP3008 Chip and Sharp ir distance sensor
Replies: 29
Views: 2092

Re: MCP3008 Chip and Sharp ir distance sensor

Thank you pcmanbob, I did see this in a forum about max speed, but didn't twig, thank you for all your help. Cheers Gwana

Go to advanced search