Go to advanced search

by scotty101
Thu May 24, 2018 2:50 pm
Forum: General discussion
Topic: raspberry pi zero wireless pwm+serial port
Replies: 3
Views: 108

Re: raspberry pi zero wireless pwm+serial port

hi there, how could you achieve to oen serial port and read/write from it ?? any helps ! Please It is considered poor manners to take over someone else's topic to ask your own question. Consider asking your own question in a new topic and please provide more information about what you want to do. W...
by scotty101
Thu May 24, 2018 2:45 pm
Forum: General discussion
Topic: Noobie, be gentle - signal conversion question
Replies: 7
Views: 261

Re: Noobie, be gentle - signal conversion question

I have purchased said converter but it doesn't work for my application. They are powered through handshake lines which are unused in this application and merely flip the bits and correct the voltage. I need to seperate the positive and negative voltages on the A and B lines in the ttl end to get an...
by scotty101
Thu May 24, 2018 9:40 am
Forum: Python
Topic: Merging two python scripts into one
Replies: 18
Views: 240

Re: Merging two python scripts into one

Code: Select all

exec(open("./LightsOff.py").read(), globals())
Just no.... Why would you need to do that. You can import functionality from other python programs directly using the "import" or "from <file/module> import <function>".
This is almost as bad as using subprocess to call another python program.
by scotty101
Wed May 23, 2018 4:42 pm
Forum: Python
Topic: Run any command with Sub-Processes
Replies: 3
Views: 76

Re: Run any command with Processes

I'm not near a *nix compatible machine to test but the arguments are usually passed to to subprocess as a list of string i.e. command_output = subprocess.check_output(['vcgencmd', 'measure_temp'], shell=True, universal_newlines=True) You could either try creating a list from args using mesg = list(a...
by scotty101
Wed May 23, 2018 4:26 pm
Forum: General discussion
Topic: combining raspberry hats and phats
Replies: 3
Views: 105

Re: combining raspberry hats and phats

You'll need to check if there are any pin conflicts. A good resource for this is
https://pinout.xyz/

If you are using the Adafruit OLED Bonnet, then there is a pin conflict (pin 7 and 17) between that and the OnOff SHIM.
by scotty101
Wed May 23, 2018 2:12 pm
Forum: Other projects
Topic: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux
Replies: 14
Views: 428

Re: Raspberry PI 3 ethernet link with (SOA, FTP, SSH, HTTP, mDNS, DHCP, IP) Linux

It is pointless configuring FTP etc unless you know what you are going to do with them. Why would the user of your system need to use FTP? What aspect of your project means that you need to communicate via HTTP? or SSH? The specification you've given talks about protocols not what the system actuall...
by scotty101
Wed May 23, 2018 2:06 pm
Forum: Python
Topic: Read Sensor data and continuously replace the previous data on Tkinter
Replies: 2
Views: 63

Re: Read Sensor data and continuously replace the previous data on Tkinter

A quick search to find "CPU Temp Raspberry Pi Python" finds this def get_cpu_temperature(): """get cpu temperature using vcgencmd""" process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE) output, _error = process.communicate() return float(output[output.index('=') + 1:output.rindex("'")]) You ca...
by scotty101
Wed May 23, 2018 10:10 am
Forum: Other projects
Topic: HTTP with Raspberry PI 3
Replies: 6
Views: 176

Re: HTTP with Raspberry PI 3

Your Pi can already communicate with the HTTP. No configuration required aside from connecting it to a network using an ethernet cable or WiFi. You can either use a browser to communicate with the 'other device' via HTTP or use one of the many programming languages to make an HTTP request. Without k...
by scotty101
Wed May 23, 2018 10:06 am
Forum: Italiano
Topic: Config.txt
Replies: 5
Views: 143

Re: Config.txt

by scotty101
Wed May 23, 2018 9:02 am
Forum: General discussion
Topic: rpi W /app inventor/gpio
Replies: 3
Views: 134

Re: rpi W /app inventor/gpio

and for the question have you a idea ? - the control of the servo goes well when I pass and goes line by line in the terminal ssh but when I run the program .py by Thonny the servo does not move and I do not know why, there is no message of error in the shell ... it's been days that I'm on without ...
by scotty101
Wed May 23, 2018 8:59 am
Forum: Python
Topic: Can I use MySQL as a way to store and edit python variables
Replies: 4
Views: 115

Re: Can I use MySQL as a way to store and edit python variables

Databases are intended to be written and read from. Don't worry about it. Consider how often your program needs to read from the database though. If it has just updated a variable, it shouldn't need to read it right back again. Keep an "in-memory" copy of all your variables that is loaded from the d...
by scotty101
Wed May 23, 2018 8:43 am
Forum: Mathematica
Topic: [Question] Perimeter
Replies: 11
Views: 253

Re: [Question] Perimeter

The information at this link seems helpful
http://alienryderflex.com/polygon/
by scotty101
Tue May 22, 2018 4:25 pm
Forum: General discussion
Topic: rpi W /app inventor/gpio
Replies: 3
Views: 134

Re: rpi W /app inventor/gpio

import RPi.GPIO as GPIO GPIO.setmode (GPIO.BOARD) GPIO.setup (11, GPIO.OUT) or 16 pwm = GPIO.PWM (11,50) pwm.start (14 pwm.ChangeDutyCycle (7) pwm.stop () GPIO.cleanup () Looks like you have a few mistakes in your code -"or 16" shouldn't be there -pwm.start(14 should end with a ) More importantly w...
by scotty101
Tue May 22, 2018 4:09 pm
Forum: General discussion
Topic: raspberry pi zero wireless pwm+serial port
Replies: 3
Views: 108

Re: raspberry pi zero wireless pwm+serial port

Can you be a bit more specific?
You can open a serial port but you don't open PWM.

Do you want to write a program that both reads/writes serial data and controls a PWM signal on a GPIO pin?
In which programming language would you like to do this?
What have you tried so far?
by scotty101
Tue May 22, 2018 4:04 pm
Forum: General programming discussion
Topic: Pi gauge visualization
Replies: 2
Views: 82

Re: Pi gauge visualization

How is this different to your other post?
viewtopic.php?f=32&t=214125&p=1318557#p1318557
by scotty101
Tue May 22, 2018 12:05 pm
Forum: Python
Topic: GUI, gauge and touchscreen
Replies: 4
Views: 122

Re: GUI, gauge and touchscreen

Both Kivy and PyQT will work with the touchscreen.

I'm not a Kivy expert but I believe you have to use at least a little KV in order to design the layout of the GUI and the coding is done in python.
by scotty101
Tue May 22, 2018 9:41 am
Forum: General discussion
Topic: Noobie, be gentle - signal conversion question
Replies: 7
Views: 261

Re: Noobie, be gentle

You can buy TTL to RS-422/485 converters. This will deal with converting the electrical signal to the correct format. Can't tell you whether the data protocol will be the same as you haven't provided any information about the sending and receiving devices. If you specifically want to do this with a ...
by scotty101
Tue May 22, 2018 9:34 am
Forum: Other projects
Topic: Tracking notice board
Replies: 3
Views: 133

Re: Tracking notice board

You could do something with barcode scanners to "check in" the specimens and record their progress though various stages. You'd also need a database with information about each sample and it's priority. It is unlikely that there is an existing project that will meet your exact needs but this is cert...
by scotty101
Tue May 22, 2018 9:28 am
Forum: Python
Topic: GUI, gauge and touchscreen
Replies: 4
Views: 122

Re: GUI, gauge and touchscreen

Tkinter doesn't have any gauges "built in" with the possible exception of a progress bar. I've made a few tkinter gauges, but (mainly due to my poor graphics skills) they never look that great. There do appear to be some gauges available for Kivy and you might also want to consider QT (either PyQT o...
by scotty101
Mon May 21, 2018 12:54 pm
Forum: General discussion
Topic: how to transer image from one pi to another pi
Replies: 1
Views: 85

Re: how to transer image from one pi to another pi

Perhaps if you share the code you used to unpack and send the data, someone might be able to help you to write the code to recieve and re-pack the data.

FYI there are many existing protocols for transmitting files via serial links. XMODEM or kermit for example
by scotty101
Mon May 21, 2018 11:25 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 330

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

Just add a new line after you've written the results.

Code: Select all

    with open("/home/pi/data_log.csv", "a") as file:
            if os.stat("/home/pi/data_log.csv").st_size == 0:
                file.write("CH0,CH1,CH2,CH3,CH4,CH5,CH6,CH7\n")
            file.write(results)
            file.write('\n')
by scotty101
Fri May 18, 2018 11:48 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 330

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

You need to take responsibility for your own learning. Copy and Pasting other people's code will only get you so far. Python is easy but you won't find it easy if you try to jump in right at the deep end without first understanding the basics. Do you actually understand the code that you've been giv...
by scotty101
Fri May 18, 2018 10:44 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 330

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

It won't... unless you happen to want a file that just says values[i] values[i] values[i] values[i] values[i] values[i] values[i] values[i] .... 1. Read the psuedo code I gave you. 2. Realise that file.write('values[ ­i]') will just output the text values[ i] not the i-th value of the array called v...
by scotty101
Fri May 18, 2018 10:33 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 330

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

So you probably need to change your code. At the moment your while loop where you read the GPIO pin won't do what you expect. Here is some psuedo code for you While Loop - Infinite Loop for each of the 8 ADC channels Read ADC channel i and store it to values[i] End loop print out to screen all 8 ADC...
by scotty101
Fri May 18, 2018 10:23 am
Forum: Troubleshooting
Topic: MCP 3008 Chip sending data to CSV file via switch
Replies: 21
Views: 330

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

Ghwana wrote:
Fri May 18, 2018 9:58 am
sent to csv through switch,
What does "through switch" mean?

Go to advanced search