Hot answers tagged

5

Okay, I have solved my problem. I reinstalled Python 3.6. Then I used this command sudo apt-get install libhdf5-dev and then sudo pip install tensorflow and installed TensorFlow successfully! I think the problem was with my Python installation. Thanks to all of you for your kindness. Cheers!!!


4

12V pump will require 12V PSU. 20LPM is a pretty reasonable flow rate for a small pump so your pump PSU will need to have enough power to drive the pump - check the max current draw on startup (which will be higher than the running power draw) and size the PSU accordingly. Check the contact handling voltage/current for your relays. "5V" relays (as ...


3

Most relays are Active LOW - the relay is ON when the input is LOW and OFF when the input is HIGH. The specification for your relay board should state this.


3

What is a line follower robot? Line follower or Line detector is an autonomous robot that follows either black line in white are or white line in the black area. The robot must be able to detect a particular line and keep following it. You can implement it by camera or IR. As you specify, you want to do it by camera. In this case, you have a lot of options....


2

Depending how the ads1115 is connected to the PCA9546 there are several ways to approach. For example if the 4 ads1115 is pinned out to have different address ( the ads1115 support upto 4 address; 0x48,0x49,0x4a,0x4b) you may use this line of code to select 1 - 4 channels, assuming the address of the PCA9546 is 0x77 i2c.writeto(0x77, bytes([0x01]), stop=...


2

Here is what comes to mind first, but maybe there are other ways. Using FIFO file, arecord tool and using python here, something like this must be possible. :


2

From here # python2.7 >>> from pythonwifi.iwlibs import Wireless >>> wifi = Wireless('wlan') >>> wifi.getEssid() 'romanofski' >>> wifi.getMode() 'Managed' And here def scan(self): """ Returns Iwscanresult objects, after a successful scan. """ return Iwscan(self.ifname) So # python2.7 >>> from ...


2

Is there a reason why you want to stream via your Python script, as opposed to streaming to VLC directly? [socket] -> Python -> [pipe] -> VLC vs [socket] -> VLC You just add another interface (a pipe between Python and VLC) which adds some delay and jitter and doesn't seem to do any useful processing. Especially since you seem to read ...


2

CoderMike's Answer addressed the problems in your code, but if you are actually using the relay module pictured and have wired it in a similar manner there are more concerns. There are a number of similar (poorly-designed) relay modules on the market - they seem to infect ebay! They may work with Arduino (and TTL logic) BUT ARE A LOUSY DESIGN even for that ...


2

Firstly does the following turn your relay on then off? import RPi.GPIO as GPIO,time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(7,GPIO.OUT) print('on') GPIO.output(7,GPIO.LOW) time.sleep(4) print('off') GPIO.output(7,GPIO.HIGH) You also need to add timeouts to your distance sensing code otherwise your code could get stuck in a while ...


1

Maybe you could use a framework like Flask. With that you can create a webserver with only a few lines of code. And because it is written in python, you can use the classes you created already :)


1

Firstly I am assuming that your program cao.py is actually locate in /home/pi/Desktop Your question appears to have the path wrong and the Desktop folder spelt wrong. I've create the following simple program as an example: import time print('cao') time.sleep(10) To run this program on its own open a 'Terminal' window and use: python3 /home/pi/Desktop/...


1

Yes. You can do far better. My pigpio Python module will give a million steps for frequencies less than 250 Hz. pigpio will give a resolution of 250 million divided by the frequency in hertz that you want to use. See hardware_PWM Example Script #!/usr/bin/env python import time import pigpio PWM=18 FREQ=5000 pi = pigpio.pi() if not pi.connected: ...


1

In the second section of code: gpioConfig=[19] so i=19 j=1 and never increments newState=statuses['gpio1'] which gives 1 As newState == 1, GPIO 19 is only every set to HIGH


1

How simultaneously do you need it to be? If "within a couple of seconds" is fine, then just call your scripts sequentially via SSH: sshpass -p 'raspberry' ssh pi@192.168.0.2 python take_photo.py & sshpass -p 'raspberry' ssh pi@192.168.0.3 python take_photo.py & You may want to setup a passwordless login to make the commands simpler. If you need to ...


1

I expect the error is given because there is no module named lcddriver.py which is what import lcddriver will be looking for. Rename lcddriver to lcddriver.py.


1

If you do not have special requirements to compile OpenCV from source it is not a good idea to do it, in particular by newbies. You find the OpenCV library in the default Raspbian repository. Just look at it with: rpi ~$ apt list *opencv* You will find 75 packages. Just pick that one you need and install it. rpi ~$ sudo apt install python3-opencv may be ...


1

Question How to use Rpi4B to control multiple ADS1115 I2C ADCs, using PCA9546/TCA9548A I2C Multiplexer? Answer (1) PCA9645 Datasheet Section 6.1 explains the device slave address is 0x70 to 0x77. In other words, 7 PCA9645s can be placed on the same I2C bus. You use A2, A2, A0 address decode pins/bits to select which PCA9685 device (not channel) to use. ...


1

I've come up with a solution! import Tkinter import sys import os # check if if os.environ.get('DISPLAY','') == '': print('no display found. Using :0.0') os.environ.__setitem__('DISPLAY', ':0.0') master = Tkinter.Tk() #master.title("tester") #master.geometry("300x100") # Lay out label #label.pack() # Run forever! master.mainloop()


1

Apparently the problem is noise on the PIR power line triggering the PIR. This can be caused by virtually any other device, even the MCU doing something. I have the same problem caused by the MCU going into sleep mode. Some suggest filters on the power line, some get away with delaying re-arming of the PIR until nothing else is happening which could cause a ...


Only top voted, non community-wiki answers of a minimum length are eligible