Go to advanced search

by scotty101
Wed Apr 24, 2019 9:15 am
Forum: Python
Topic: Global and Local namespace
Replies: 1
Views: 45

Re: Global and Local namespace

Because print("After global assignment:", spam) is printing the variable spam which exists inside the scope_test namespace rather than the global name space. Run your code though the visualiser at http://www.pythontutor.com/visualize.html#mode=display to see what variables are created and where they...
by scotty101
Wed Apr 24, 2019 8:35 am
Forum: General discussion
Topic: controlling 2 maxon motors with 2 EPOS4'S controllers
Replies: 2
Views: 55

Re: controlling 2 maxon motors with 2 EPOS4'S controllers

I'm guessing that the OP means these devices http://academy.maxonjapan.co.jp/wp-content/uploads/manual/epos4/EPOS4-Communication-Guide-En.pdf They are pretty complex devices and there are several reference manuals for them. From the communication guide it seems that they can be controlled via USB/RS...
by scotty101
Tue Apr 23, 2019 3:35 pm
Forum: Troubleshooting
Topic: 50 pin cable TFT screen for Raspberry PI 3 B+
Replies: 13
Views: 206

Re: 50 pin cable TFT screen for Raspberry PI 3 B+

Unlikely but you haven't share any information about the screen aside from the fact it has 50 pins. Try sharing a link to the product.

Next time check for compatibility before entering your payment details.
by scotty101
Tue Apr 23, 2019 10:45 am
Forum: General discussion
Topic: Conferencing service
Replies: 2
Views: 87

Re: Conferencing service

In theory it is possible.

Video chat/conference apps that work on the Raspberry Pi can use the official Pi Camera as if it was just any other Webcam.

You'd need to find a conferencing service with software that supports the Raspberry Pi.
by scotty101
Tue Apr 23, 2019 10:33 am
Forum: Python
Topic: Event Timer
Replies: 1
Views: 60

Re: Event Timer

Any particular part? There is a lot there to explain.
by scotty101
Thu Apr 18, 2019 4:32 pm
Forum: Python
Topic: Adding variables to connection scripts
Replies: 2
Views: 46

Re: Adding variables to connection scripts

The SPI function is expecting the value of board.MOSI (presumably a number) but you are passing it the string "board.MOSI".

Your config should be

Code: Select all

"portMOSI": board.MOSI,
not

Code: Select all

"portMOSI": "board.MOSI",
by scotty101
Thu Apr 18, 2019 11:26 am
Forum: Beginners
Topic: How to calculate resistors...
Replies: 55
Views: 923

Re: How to calculate resistors...

You need an electronics book/online tutorial Consider a simple circuit, an ideal circuit where wires have no resistance and batteries can supply infinite current. In this circuit, we connect the battery terminals together by our zero resistance wires. Battery voltage is 1.5V. I = V/R I = 1.5/0 I = I...
by scotty101
Thu Apr 18, 2019 11:10 am
Forum: General discussion
Topic: Max Power Supply For Raspberry Pi 3 b +
Replies: 34
Views: 698

Re: Max Power Supply For Raspberry Pi 3 b +

Then you might be out of luck. The Pi's internal power supplies and protection circuits will only provide so much current.
If you need more, you have to use an external supply.
by scotty101
Thu Apr 18, 2019 11:05 am
Forum: General discussion
Topic: Max Power Supply For Raspberry Pi 3 b +
Replies: 34
Views: 698

Re: Max Power Supply For Raspberry Pi 3 b +

Perhaps you can explain a bit about your project and why you need more current from the 5V and 3.3v supplies? You can certainly use a separate power supply to power any extra components that require more current. I've used a few motor/amplifier HATs/pHATs which take a wide range input voltage, conv...
by scotty101
Thu Apr 18, 2019 10:42 am
Forum: General discussion
Topic: Max Power Supply For Raspberry Pi 3 b +
Replies: 34
Views: 698

Re: Max Power Supply For Raspberry Pi 3 b +

Perhaps you can explain a bit about your project and why you need more current from the 5V and 3.3v supplies? You can certainly use a separate power supply to power any extra components that require more current. I've used a few motor/amplifier HATs/pHATs which take a wide range input voltage, conve...
by scotty101
Thu Apr 18, 2019 10:17 am
Forum: Beginners
Topic: Voice over BLE
Replies: 6
Views: 164

Re: Voice over BLE

What is the BLE device (make, model, link)? As there is no standard for streaming audio with BLE, and no implementations that I know of, your request may prove difficult. chayma, You still haven't answered what the make or model of the device is. Nobody can help you if they don't know what type of ...
by scotty101
Wed Apr 17, 2019 8:35 am
Forum: Automation, sensing and robotics
Topic: Grove Gesture Sensor (PAJ7620u2) + Power Button
Replies: 3
Views: 84

Re: Grove Gesture Sensor (PAJ7620u2) + Power Button

Its a pain. See https://www.raspberrypi.org/forums/viewtopic.php?t=225832 GPIO3 can be used to wake the Pi as the I2C interface isn't active when the Pi is in it's halt mode but it can't be used as a shutdown pin because the grove sensor needs to use the I2C interface. You can have two buttons, one ...
by scotty101
Wed Apr 17, 2019 8:27 am
Forum: Automation, sensing and robotics
Topic: Grove Gesture Sensor (PAJ7620u2) + Power Button
Replies: 3
Views: 84

Re: Grove Gesture Sensor (PAJ7620u2) + Power Button

You can't use both the sensor and the button on the same GPIO pin.

Swap the button on to another GPIO pin. See this site (https://pinout.xyz/) to figure out which GPIO pins are available.
by scotty101
Wed Apr 17, 2019 8:11 am
Forum: Beginners
Topic: Webiopi with pi sense hat
Replies: 3
Views: 67

Re: Webiopi with pi sense hat

Perhaps if you share the code you have written so far, someone might be able to help you debug it.
by scotty101
Tue Apr 16, 2019 12:53 pm
Forum: Networking and servers
Topic: how can we exange data between raspberry pi and nodemcu without using mqtt protocol .
Replies: 2
Views: 78

Re: how can we exange data between raspberry pi and nodemcu without using mqtt protocol .

Do you want wired or wireless communication?

If you want wireless then you could just send simple UDP messages between the two devices.
https://arduino-esp8266.readthedocs.io/ ... mples.html

I have a NodeMCU communicating with a raspberry pi using HTTP.
by scotty101
Mon Apr 15, 2019 12:40 pm
Forum: General discussion
Topic: Nexdock 2 - another shot
Replies: 9
Views: 507

Re: Nexdock 2 - another shot

buja wrote:
Sun Apr 14, 2019 11:34 am
Just hope the manufacturing campaign will go equally well.
And that their factory doesn't have a fire.. and that they actually test them before they are sent out...
by scotty101
Fri Apr 12, 2019 12:07 pm
Forum: General discussion
Topic: finding spO2 using raspberry pi
Replies: 1
Views: 63

Re: finding spO2 using raspberry pi

You need two different sensors to gauge the blood oxygen saturation. One that reads the the visible light and another that reads the Infra Red part of the spectrum. It is the relationship between the readings of these two sensors that gives you the spO2. See https://www.instructables.com/id/Arduino-...
by scotty101
Fri Apr 12, 2019 12:04 pm
Forum: Networking and servers
Topic: How to move a website to RPI
Replies: 3
Views: 119

Re: How to move a website to RPI

There are many guides out there already for transferring WordPress sites from one server to another

https://www.znetlive.com/blog/how-to-tr ... o-another/
by scotty101
Fri Apr 12, 2019 11:21 am
Forum: Beginners
Topic: How to run an executable file from CRON?
Replies: 5
Views: 107

Re: How to run an executable file from CRON?

would I put something like '0 1 * * * ./executable-file-name /dir1/dir2/dir3 Don't think so. Its something like '0 1 * * * /dir1/dir2/dir3/executable-file-name For example 0 1 * * * /home/pi/myDirectory/myProgram Remember your binary will have to be made executable using chmod +x myProgram
by scotty101
Tue Apr 09, 2019 9:58 am
Forum: Beginners
Topic: Syntax error when trying to run a code written in Idle3 shell
Replies: 2
Views: 92

Re: Syntax error when trying to run a code written in Idle3 shell

You have made the common beginners mistake with IDLE. Don't save the python interactive shell window. When you open IDLE the first window that appears is the Python interactive shell. You need to click "File -> New File" to get another window where you can paste your code. Then you can save this fil...
by scotty101
Mon Apr 08, 2019 4:32 pm
Forum: Python
Topic: Help reading txt file lines
Replies: 3
Views: 422

Re: Help reading txt file lines

Why reinvent the wheel? Why not just use the config parser module in python? https://docs.python.org/3/library/configparser.html?highlight=configparser#module-configparser You can then have a file like the following settings.ini [SETTINGS] nettest_config=0 shoot_config=1 Much easier to read that a f...
by scotty101
Thu Apr 04, 2019 10:31 am
Forum: Python
Topic: Simultaneous control of two stepper motors through a gui (pyqt 5)
Replies: 3
Views: 464

Re: Simultaneous control of two stepper motors through a gui (pyqt 5)

Two methods for you to consider PyQt like many GUI frameworks has a timer mechanism, called QTimer. Rather than using an infinite loop (V bad practice for GUIs), you should have the timer periodically call a function to change the state of the GPIO pins. Second method would be threading. Have a seco...
by scotty101
Thu Apr 04, 2019 8:34 am
Forum: General discussion
Topic: pygame display picture
Replies: 1
Views: 66

Re: pygame display picture

Any reason why you can't just download the images and save them to your Pi rather than downloading them each time?

Can you post the exact error message so that we can see which line caused the error?
by scotty101
Tue Apr 02, 2019 9:32 pm
Forum: Python
Topic: how to make a document accessible from a local flask webpage [solved]
Replies: 5
Views: 216

Re: how to make a document accessible from a local flask webpage

What type of document?
How do you want to view it on the web page?
by scotty101
Tue Apr 02, 2019 5:03 pm
Forum: Python
Topic: Setting a max time for a while loop
Replies: 5
Views: 150

Re: Setting a max time for a while loop

Much simpler way since you can cope with blocking events. import time now = time.time() delay = 10 while True: if time.time() > now + delay: print("Escaping now") break time.sleep(1) print("Escaped!!") This will enter the while loop but break out of it once 10 seconds has passed. While you are in th...

Go to advanced search