Go to advanced search

by Dangermoth
Mon Dec 17, 2018 7:55 pm
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 363

Re: [solved] touch very inaccurate under rc.local

Hey guys, the autostart thing works a treat, mouse calibration now spot on, many thanks for you help. :P
by Dangermoth
Fri Dec 14, 2018 7:29 pm
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 363

Re: touch very inaccurate under rc.local

OK, I'm going to try autostart, this looks very intimidating and is way deeper than I want to get into linux, in my experience typing cryptic commands into the text editor always ends badly, before I take the plunge how do I get the text editor back up when the pi fails to boot? I'm more than happy ...
by Dangermoth
Fri Dec 14, 2018 2:16 pm
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 363

Re: touch very inaccurate under rc.local

Ok thanks, that makes perfect sense now about rc.local, I have found a tutorial for systemd which sounds a lot more promising so I will try that. Adding 'disable_splash=1' doesn't appear to make any difference, I may have read somewhere that if using NOOBS the system boots twice I wonder if that mig...
by Dangermoth
Fri Dec 14, 2018 10:35 am
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 363

Re: touch very inaccurate under rc.local

Thanks I appreciate your reply. I used 'sudo' because I used this example that used it; https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/ When I start it normally I right click on the file icon and open with python2, or when I said I open it via rc.local manually ...
by Dangermoth
Fri Dec 14, 2018 8:17 am
Forum: Troubleshooting
Topic: [solved] touch very inaccurate under rc.local
Replies: 6
Views: 363

[solved] touch very inaccurate under rc.local

Hey all, apologies if this is a dumb question I've searched but struggled to find an answer. I did originally post this in the python section but I think it might be better off here. I'm building a screen for my truck to give speed, gps, fuel consumption ect. I can boot into the python / pygame appl...
by Dangermoth
Thu Dec 13, 2018 7:47 pm
Forum: Python
Topic: Touch screen mouse random under rc.local
Replies: 0
Views: 124

Touch screen mouse random under rc.local

Hey all, apologies if this is a dumb question I've searched but struggled to find an answer. I'm building a screen for my truck to give speed, gps, fuel consumption ect. I can boot into the python / pygame application and in theory shutdown via an on screen button press, my issue is that if I boot i...
by Dangermoth
Wed Dec 12, 2018 10:24 am
Forum: Beginners
Topic: (solved) python forecastio / darksky displaying current data
Replies: 5
Views: 730

Re: (solved) python forecastio / darksky displaying current data

neilgl that's perfect, works a treat thankyou so much :P I tried all permutations of print but couldn't get anything to work, sometimes you can spend days fruitlessly trawling through the Internet trying to find something basic in fear of being flamed, then just give up and ask then have the answer ...
by Dangermoth
Sat Dec 08, 2018 12:05 pm
Forum: Beginners
Topic: (solved) python forecastio / darksky displaying current data
Replies: 5
Views: 730

Re: python forecastio / darksky displaying current data

Yes this is the 1000 free api calls per day, I'm so glad other people know of the system. This is my weather station, I'm pretty pleased with it especially as its my very first use of both a pi and python! weather small.JPG My issue is that my company is moving premises soon to a building not dissim...
by Dangermoth
Fri Dec 07, 2018 5:05 pm
Forum: Python
Topic: cant get mouse co-ordinates within function loop
Replies: 0
Views: 288

cant get mouse co-ordinates within function loop

Hey guys, pretty basic issue here I'm sure you can help with. I'm writing a bit of python code that will display one of several graphical pages on pygame. I've done this a few times using a single page and it works really well. I now want to expand so I have several pages that can display different ...
by Dangermoth
Fri Dec 07, 2018 2:57 pm
Forum: Beginners
Topic: (solved) python forecastio / darksky displaying current data
Replies: 5
Views: 730

(solved) python forecastio / darksky displaying current data

Afternoon all, I am currently building an internet based weather staiton to display the current weather information i.e. temperature, humidity ect. using the Darksky api and python forsastio. The problem is that I can print the current weather summary and current text that I can use to display an ap...
by Dangermoth
Fri Nov 23, 2018 7:24 pm
Forum: Beginners
Topic: returning values from functions
Replies: 6
Views: 452

Re: returning values from functions

Thanks for the quick reply guys, I just now found adding 'global result' after the 4th line seems to work as well, I guess this is how I make the variable a global although I believe thats frowned upon in python. I did try python 3 but had too many issues, the main one being that rpi_backlight refus...
by Dangermoth
Fri Nov 23, 2018 7:07 pm
Forum: Beginners
Topic: returning values from functions
Replies: 6
Views: 452

returning values from functions

Afternoon all, OK, flame suit on, I sure someone can help with this one. I've written quite a few PRI programs such as graphical Pygame weather stations that have been running a treat for many months but I've always been limited as I have never been able to return any sort of returned value from a f...
by Dangermoth
Tue Jul 24, 2018 2:30 pm
Forum: Beginners
Topic: rpi_backlight no module found
Replies: 4
Views: 427

Re: rpi_backlight no module found

Aha, I don't seem to have Python 2 installed, slightly annoying as I've always used python 2 for all projects up to now on other pi's. I'm sure python 2 must be installed somewhere but does not show up under the 'programming' drop down menu, any idea's were it might be hiding? if I type dpkg --get-s...
by Dangermoth
Tue Jul 24, 2018 2:15 pm
Forum: Beginners
Topic: rpi_backlight no module found
Replies: 4
Views: 427

Re: rpi_backlight no module found

If I type;

dpkg --get-selection

Should rpi_backlight show up in the list??

BTW I'm running Raspian stretch.
by Dangermoth
Tue Jul 24, 2018 1:06 pm
Forum: Beginners
Topic: rpi_backlight no module found
Replies: 4
Views: 427

rpi_backlight no module found

Hey guys, I wonder if anyone can shed some light on this one as I don't know were to start, I've installed rpi_backlight and edited the rules however if I type "import rpi_backlight" in python 3 idle I get a traceback error "ImportError:No module named 'rpi_backlight'" I have done the following; pip...
by Dangermoth
Mon Feb 26, 2018 4:37 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Thanks for your help guys, I was kind of hoping this would only take a couple of minutes as per my little 'C' example above but Python can be a very tricky and frustrating beast when your not used to it.

I don't have a internet connected to the Pi at the moment so can't post the code.
by Dangermoth
Mon Feb 26, 2018 2:04 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Sorry I got called away,

It's still not working, I'm kind of thinking I should do the calculation and comparison on the Arduino as I do with the max / min temperature, this looks to be a lot more in depth using Python than I thought.
by Dangermoth
Mon Feb 26, 2018 1:25 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Sorry, forgot to mention it is indeed within a function. So the code you posted works for you as it is? I already have a function that reads the wind speed and temperature from the arduino, calculates the wind chill and prints it on a Pygame screen, as I don't know how to read variables between fun...
by Dangermoth
Mon Feb 26, 2018 1:15 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Sorry, forgot to mention it is indeed within a function.
by Dangermoth
Mon Feb 26, 2018 1:07 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

So if I type "wind_chill_max = 0" at the top of the code does this mean its a global value and not local?

Sorry for the stupid question, I'm still trying to get my head around Python after using C for many years.
by Dangermoth
Mon Feb 26, 2018 1:00 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Or you can use a min / max function: wind_chill_max = max(wind_chill, wind_chill_max) No joy with that one either, I've just read the error again and it is saying; Unbound Local Error: Local Variable 'wind_chill_max' referenced before assignment No idea what it means but its trying to tell me somet...
by Dangermoth
Mon Feb 26, 2018 12:53 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Interesting,

I'm using Python IDLE2, can't think that would make too much difference?
by Dangermoth
Mon Feb 26, 2018 12:47 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Sorry, still no joy.
by Dangermoth
Mon Feb 26, 2018 12:38 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

Re: if x < y then x = y

Thanks for the quick reply.

I have already done this, and copy and pasted to make sure there are no spelling differences.


Edit
I have done this routine several times on the Arduino that is reading the analog signals ( min / max temperature ect) but the wind chill is being calculated on the Pi.
by Dangermoth
Mon Feb 26, 2018 12:28 pm
Forum: Beginners
Topic: if x < y then x = y
Replies: 27
Views: 1512

if x < y then x = y

OK, stupid question of the day. I want to store the maximum (or is it minimum) wind chill figure on my weather station. To do this in 'C' I can do something like: if (wind_chill < wind_chill_max) wind_chill_max = wind_chill; I can't find a way to do it in python, I've tried: if wind_chill < wind_chi...

Go to advanced search