Go to advanced search

by scotty101
Sat Feb 23, 2019 8:56 am
Forum: Python
Topic: Functions
Replies: 3
Views: 99

Re: Functions

Import is the wrong term

If you wish to use the variable steps inside the xplus function, you should pass steps as an argument when you call xplus.

Alternatively, you can use global variables to make steps accessible by both functions.
by scotty101
Fri Feb 22, 2019 9:59 am
Forum: Python
Topic: I cant figure out whats wrong with my code
Replies: 3
Views: 115

Re: I cant figure out whats wrong with my code

That's because you don't have a global variable called weather. Create an "empty" variable for each of the parameters near the start of your program. from sense_hat import SenseHat sense = SenseHat() weather = "" today_high = "" today_low = "" next_low = "" next_high = "" next_forecast = "" # Flicke...
by scotty101
Fri Feb 22, 2019 9:46 am
Forum: General discussion
Topic: It can able to support sort of touchscreen?
Replies: 3
Views: 84

Re: It can able to support sort of touchscreen?

There is an official 7" touch screen available for the Pi

https://thepihut.com/collections/raspbe ... en-display
by scotty101
Thu Feb 21, 2019 11:41 am
Forum: General discussion
Topic: Connecting a tactile switch
Replies: 13
Views: 402

Re: Connecting a tactile switch

At the present time the project is complete and I am doing testing. I sometimes have problems with the switch. It seems as if it got stuck and keeps calling the functions that handle the tactile switch repeatedly as if the switch is held down. I remove the switch and it still loops. Would this be b...
by scotty101
Thu Feb 21, 2019 11:38 am
Forum: General discussion
Topic: Add a button or switch to issue a command or task
Replies: 1
Views: 40

Re: Add a button or switch to issue a command or task

Perhaps start with the basics of physical computing on the Pi. It will cover most of your questions. https://projects.raspberrypi.org/en/projects/physical-computing Once you've followed that you will have an idea of how to use a button to make events happen on a Pi. You can then write some code that...
by scotty101
Thu Feb 21, 2019 9:35 am
Forum: Beginners
Topic: GPIO IR receiver
Replies: 5
Views: 105

Re: GPIO IR receiver

The site where I bought it said it was an IR receiver so it is not of a wrong type. Could it be possible to impleent what the 3 pin does with the 2 pin one? How does the 2 pin work? I have no doubt that the sensor you bought is sensitive to IR light but it is not the type normally used to read sign...
by scotty101
Wed Feb 20, 2019 5:51 pm
Forum: Beginners
Topic: GPIO IR receiver
Replies: 5
Views: 105

Re: GPIO IR receiver

That doesn't help because they utilize 3 pin ir receiver and mine has only 2. Additionaly, why do I need LIRC for? I just want to record what I receive. You have the wrong type of receiver then. IR Remotes typically output a modulated signal (44Khz I think). The 3 pin type devices provide the demod...
by scotty101
Wed Feb 20, 2019 9:57 am
Forum: Gaming
Topic: Fortnite
Replies: 27
Views: 10842

Re: Fortnite

Imperf3kt wrote:
Wed Feb 20, 2019 7:51 am
The Pi, cannot be compared to it because it is ARM based, with 1GB of RAM and no dedicated GPU.
Is that true? I'm pretty sure that the Pi's SOC is mainly GPU with a ARM CPU bolted on.
by scotty101
Tue Feb 19, 2019 1:17 pm
Forum: Other programming languages
Topic: Accessing Analog Ouput of R-Pi with MATLAB
Replies: 5
Views: 87

Re: Accessing Analog Ouput of R-Pi with MATLAB

The Mathworks website lists what devices are supported by the "MATLAB Support Package for Raspberry Pi Hardware". https://uk.mathworks.com/help/supportpkg/raspberrypiio/referencelist.html?type=function I2C and SPI are supported so you should be able to connect a DAC via one of those interfaces but t...
by scotty101
Tue Feb 19, 2019 1:13 pm
Forum: General programming discussion
Topic: How to auto-detect a song currently playing in a room?
Replies: 2
Views: 119

Re: How to auto-detect a song currently playing in a room?

The Google AIY kit might be a good start. I think it already supports "What is this song?" type questions.
by scotty101
Tue Feb 19, 2019 12:15 pm
Forum: Other programming languages
Topic: Accessing Analog Ouput of R-Pi with MATLAB
Replies: 5
Views: 87

Re: Accessing Analog Ouput of R-Pi with MATLAB

MATLAB type questions are generally best asked on the MATLAB website.

Most Pi users can't afford MATLAB.
by scotty101
Tue Feb 19, 2019 8:21 am
Forum: Graphics, sound and multimedia
Topic: Stacking DAC+ Boards Possible?
Replies: 2
Views: 104

Re: Stacking DAC+ Boards Possible?

What type of DAC board?
It will depend massively on whether the manufacturer of the boards designed them for this purpose or not.

Most of the boards I have seen do not support stacking.
by scotty101
Mon Feb 18, 2019 10:49 pm
Forum: Python
Topic: Use NUMPY to store gpio keypad values from matrix in list / array?
Replies: 2
Views: 55

Re: Use NUMPY to store gpio keypad values from matrix in list / array?

From what you've described I don't believe that numpy is necessary. Regular python lists should do.

Rather than just printing the value, append it to a list.
by scotty101
Mon Feb 18, 2019 5:06 pm
Forum: Beginners
Topic: Ring doorbell equivalent
Replies: 3
Views: 122

Re: Ring doorbell equivalent

Are you looking for an existing "kit" with software to make a ring doorbell or are you just looking for the software?

I suspect regardless of your answer, the end result will be that you will have to write your own.
by scotty101
Mon Feb 18, 2019 11:21 am
Forum: Python
Topic: Introducing a large quantity of Variables
Replies: 13
Views: 232

Re: Introducing a large quantity of Variables

bensimmo wrote:
Sun Feb 17, 2019 5:34 pm
In python there are list comprehensions

....

For and list of 24 zero's

Code: Select all

hour_listofzeros = [0] * 24
 
print(hour_listofzeros)
Technically not a list comprehension.

This would be one to do the same thing though

Code: Select all

x = [0 for a in range(24)]
by scotty101
Mon Feb 18, 2019 11:03 am
Forum: Advanced users
Topic: Which Rasp for "pro" project?
Replies: 14
Views: 360

Re: Which Rasp for "pro" project?

The problem is more about the potential key access to my WebServices who can be read in the program... You shouldn't be writing password/keys in your source code. Find another way to store the data. Environment Variables are often mentioned as a way to do this but I suspect that "Real world applica...
by scotty101
Thu Feb 14, 2019 5:37 pm
Forum: General discussion
Topic: Installing wxPython4
Replies: 3
Views: 104

Re: Installing wxPython4

If the problem is to do with the whl, have you tried installing it from piwheels which should be pre-built?

https://www.piwheels.hostedpi.com/

Might be too soon for wxPython 4.04 to be on there though.

You'll have to post the error messages.
by scotty101
Thu Feb 14, 2019 1:40 pm
Forum: Python
Topic: Hex and serial variable
Replies: 2
Views: 80

Re: Hex and serial variable

Try

Code: Select all

ser.write(CW.encode('utf-8'))
By default python3 will read strings in as unicode strings but you need to convert them to bytes for sending out the serial port.
by scotty101
Tue Feb 12, 2019 4:12 pm
Forum: Graphics, sound and multimedia
Topic: Dedicated Stream Viewer?
Replies: 1
Views: 74

Re: Dedicated Stream Viewer?

You could automatically open VLC to view the stream once the Raspbian GUI opens.

This sparkfun link talks about how to auto run something
https://learn.sparkfun.com/tutorials/ho ... -autostart
by scotty101
Tue Feb 12, 2019 12:10 pm
Forum: Beginners
Topic: RPi to WebAPI?
Replies: 4
Views: 94

Re: RPi to WebAPI?

I am planning to use PI Web API: https://techsupport.osisoft.com/Documentation/PI-Web-API/help/getting-started.html Are you sure that is suitable? Seems overly complex for what you are describing. You know the PI doesn't mean Raspberry Pi? Did you just google Pi Web API? Why not something designed ...
by scotty101
Tue Feb 12, 2019 10:56 am
Forum: Beginners
Topic: RPi to WebAPI?
Replies: 4
Views: 94

Re: RPi to WebAPI?

How do I push up temperature data gathered by sensor on my RPi to WebAPI? What setup and config would this require? Which webapi? Some have their own python libraries, some have a simple API that can be accessed by using HTML POST data or JSON. Generally speaking, you'll need to pick an API, perhap...
by scotty101
Mon Feb 11, 2019 8:54 pm
Forum: Beginners
Topic: chapest way to have 4+ isolated 422 ports
Replies: 2
Views: 88

Re: chapest way to have 4+ isolated 422 ports

Andyroo wrote:
Mon Feb 11, 2019 8:31 pm
You will have to build the circuit and bitbang the comms. As a guess this would cost more than a standard interface with standard software...
No need to bit bang the interface. Either an Quad SPI UART or USB UART would do the job when combined with an isolated 422 driver.
by scotty101
Mon Feb 11, 2019 10:58 am
Forum: General discussion
Topic: Reading Sensor Data from Sensehat using I2C
Replies: 1
Views: 54

Re: Reading Sensor Data from Sensehat using I2C

Any reason why you aren't using the official python library to read the sensor data?

I think you'll need to share a more complete example of your code inside code tags [code][/code] if you want help debugging
by scotty101
Mon Feb 11, 2019 10:52 am
Forum: Raspbian
Topic: Easiest way to send a looped string to /dev/ttyAMA0?
Replies: 3
Views: 82

Re: Easiest way to send a looped string to /dev/ttyAMA0?

Everything in linux is a file. If you write some text to /dev/ttyAMA0 it will be sent out of the serial port. echo 'Hello World' > /dev//dev/ttyAMA0 Would write "Hello World" out of the serial port. You are also likely to need to use the stty command to setup the correct baud rate for the serial por...

Go to advanced search