Go to advanced search

by Paeryn
Fri Sep 21, 2018 8:18 pm
Forum: Official Foundation Display
Topic: GTK3 Comboboxes unusable on touch display
Replies: 4
Views: 92

Re: GTK3 Comboboxes unusable on touch display

It could be that GTK+3's combo-box suffers from being too sensitive, clicking it brings the selections up and requires a second click to choose an option. However if the pointer moves so much as 1 pixel (I think, definitely very little movement) whilst that first click happens then it automatically ...
by Paeryn
Fri Sep 21, 2018 2:01 am
Forum: Troubleshooting
Topic: The USB power appeal
Replies: 32
Views: 773

Re: The USB power appeal

I may be wrong, I've never had anything needing much power plugged in. All my RPI3 B USB died when I was trying to draw about 200mA (one device - one port - 100-300mA max) So it is definitely 600mA / port which is actually more than USB 2.0 standard permits. There isn't a per port limit on the RPi ...
by Paeryn
Fri Sep 21, 2018 12:03 am
Forum: Troubleshooting
Topic: The USB power appeal
Replies: 32
Views: 773

Re: The USB power appeal

From memory the max current the RPi provides for USB is 1.2A shared between the 4 ports (used to be 600mA on the original RPis unless a config setting was enabled, though they only had 2 ports). I don't know if the RPi3B+ upped this to allow the full 2A (especially when powered by PoE). I've always ...
by Paeryn
Wed Sep 19, 2018 10:31 pm
Forum: Beginners
Topic: Problems with python script --> push button to send email
Replies: 9
Views: 173

Re: Problems with python script --> push button to send email

############ UNTESTED ################### # -*- coding: utf-8 -*- import smtplib from email.mime.text import MIMEText import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(16, GPIO.IN, pull_up_down = GPIO.PUD_UP) #you need an input print ( "press button to send email" ) while True...
by Paeryn
Wed Sep 19, 2018 8:33 pm
Forum: Troubleshooting
Topic: Why Multithreading slower than single threading
Replies: 7
Views: 246

Re: Why Multithreading slower than single threading

Thanks for taking the time to analyze the code, use the clock_gettime () command in my orginal program: Without threads, here I post the code that I use and the functions to which they are called, the objective is the same as the simple example that I posted previously, which is that each function ...
by Paeryn
Tue Sep 18, 2018 3:40 am
Forum: Python
Topic: Reverse in Python
Replies: 2
Views: 111

Re: Reverse in Python

Hi, I am trying to figure out what is going on in this code. How come new string is now equal to "notwen"? newstring = '' oldstring = 'Newton' for char in oldstring: newstring = char + newstring print(newstring) The for char in oldstring is a loop construct which iterates over the characters in old...
by Paeryn
Sun Sep 16, 2018 7:47 pm
Forum: Troubleshooting
Topic: Why Multithreading slower than single threading
Replies: 7
Views: 246

Re: Why Multithreading slower than single threading

The printing of the answers is going to hold things up especially as you prevent that part from executing in parallel. The way you use the single mutex could mean that if the first thread gets to the printing part by the time another thread starts then the latter thread would be prevented from start...
by Paeryn
Sun Sep 16, 2018 4:31 am
Forum: Python
Topic: int Object has no attribute GPIO
Replies: 19
Views: 271

Re: int Object has no attribute GPIO

Thanks for you guys replies. Are you saying that I have to add "code:select all" on the top of the codes? Thanks No, you put the tag [code] before and the tag [/ code] after (but without any space between the / and the word code, I can't write it out in full without it being interpreted). Alternati...
by Paeryn
Sun Sep 16, 2018 3:19 am
Forum: Troubleshooting
Topic: Why Multithreading slower than single threading
Replies: 7
Views: 246

Re: Why Multithreading slower than single threading

clock() measures CPU time not actual time. Having 4 threads running in parallel on separate cores will mean CPU time is increasing at 4 times the speed of when you only have 1 thread running. If you have 1 thread taking 4 seconds then your CPU time is 4 seconds. If you instead split the work evenly ...
by Paeryn
Sat Sep 15, 2018 7:54 pm
Forum: Python
Topic: int Object has no attribute GPIO
Replies: 19
Views: 271

Re: int Object has no attribute GPIO

When posting code you need to enclose it in [ code ] ... [ /code ] tags (sans spaces, it's awkward to type invisible spaces on Andriod) to preserve indentation, without it we can't see what statements belong to which blocks. I've added them to the quote... Hi Everyone, I am new on Python3. I tried t...
by Paeryn
Sat Sep 15, 2018 1:13 pm
Forum: Troubleshooting
Topic: Unable to get touchscreen to work with Volumino
Replies: 10
Views: 212

Re: Unable to get touchscreen to work with Volumino

Hi Yes its me Unhappy. Trying for the last time to get this to work. I have installed Volumino (SD-image) on Raspberry 3 Model B v 1.2 I bought this display: https://www.ebay.com/itm/3-5-Touchscreen-Display-LCD-Raspberry-Pi/163183340070?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649 Als...
by Paeryn
Fri Sep 14, 2018 6:19 am
Forum: Python
Topic: a multiprocessing?
Replies: 4
Views: 152

Re: a multiprocessing?

top or ps should help. Thank you for the information. I found, using top, that the multi process uses 7% of the core when it does a calculation.. I am still looking for information as to which core the process is on. I'll keep on reading the documentation in the manual. To see which core it is curr...
by Paeryn
Thu Sep 13, 2018 9:42 am
Forum: Troubleshooting
Topic: Using timer in GPIO numbering error
Replies: 10
Views: 207

Re: Using timer in GPIO numbering error

From looking at your code I can at least one major error, In the motor() function you declare StepCount to be global, twice you use its value but nowhere in the whole code to you ever assign a value to it. You do however at the start assign two different values (first 0 and then 8) to StepCounter wi...
by Paeryn
Wed Sep 12, 2018 3:01 pm
Forum: Troubleshooting
Topic: Installing bitstring
Replies: 4
Views: 85

Re: Installing bitstring

sudo pip3 install bitstring worked for me, thanks. So why is there more than one version of Python in the NOOBS install? It just means that when I install some module it disappears into a pit of darkness. I should like to use 3.5.3, and delete earlier versions. TTFN You can use Python3 perfectly fi...
by Paeryn
Mon Sep 10, 2018 12:58 pm
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 18
Views: 548

Re: we are trying to use gpio pin as chip select

Hi, Thanks for Your reply, we are operating GPIO pins using bcm2835 library for that we passing two arguments in our program but we are getting segmentation fault error while passing the arguments. Eg; write_DO(1,1) Had you called bcm2835_init() earlier in your program, if so did it return 0? If yo...
by Paeryn
Sun Sep 09, 2018 9:29 pm
Forum: C/C++
Topic: Getting nonsense from GCC floats (doubles too)
Replies: 9
Views: 330

Re: Getting nonsense from GCC floats (doubles too)

Just noticed something that doesn't look quite right, though it depends on what the line is calculating. Taking from what you said here Expressing something as a fraction of its range then multiplying by wwidth scales it to fit the screen width. That's why I do the minmax routine so I know what the ...
by Paeryn
Sun Sep 09, 2018 5:53 pm
Forum: C/C++
Topic: Getting nonsense from GCC floats (doubles too)
Replies: 9
Views: 330

Re: Getting nonsense from GCC floats (doubles too)

What I don't get right now is why, when I have uint16_t oldx, oldy; does it make a difference when I explicitly cast my values to uint16_t? oldx = ((i * 1.0)/((FFTSIZE * 1.0) - 8.0)) * (wwidth * 1.0); // oldx = (uint16_t) ((i * 1.0)/((FFTSIZE * 1.0) - 8.0)) * (wwidth * 1.0); oldy = splitat - ((((dp...
by Paeryn
Fri Sep 07, 2018 10:43 am
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 18
Views: 548

Re: raspberry pi 3 model b+ with bcm 2835

Hi, Thanks for Your reply,we have installed bcm2835 libray but now we are getting segmentation fault error while running exe file Since at this moment in time the only thing we know about this program is that one #include <bcm2835.h> line, the seg fault could be from anywhere in your program and th...
by Paeryn
Thu Sep 06, 2018 10:59 pm
Forum: Troubleshooting
Topic: Not able to run GPIO from crontab
Replies: 1
Views: 56

Re: Not able to run GPIO from crontab

Exactly what the error message says, the file's permission modes are incorrect, you have it writeable by group and/or other, it has to be set so that only root can write to it. Cron refuses to use it if anybody else has permission to write to it as there is no guarantee that an unprivileged user has...
by Paeryn
Wed Sep 05, 2018 8:39 pm
Forum: Python
Topic: Cross Compilation Tool for Python
Replies: 7
Views: 272

Re: Cross Compilation Tool for Python

I may be mistaken but I think it was the debugging part which the OP was most interested in having; being able to run code on the Pi and see what it's doing remotely, back at the desktop PC the code was developed on. One can use SSH or Telnet with traditional "print" statement and log file debuggin...
by Paeryn
Wed Sep 05, 2018 7:58 pm
Forum: Troubleshooting
Topic: Raspberry pi does not display the complete ascii table
Replies: 2
Views: 91

Re: Raspberry pi does not display the complete ascii table

ASCII is a 7-bit character set, 33 of the 128 characters aren't printable (the first 32 are control codes and the 128th is del). I'm pretty sure the terminal can display all 95 printable ASCII characters. For extended characters it will depend on which encoding is being used and whether the console'...
by Paeryn
Wed Sep 05, 2018 3:24 am
Forum: C/C++
Topic: Commenting out a comment
Replies: 11
Views: 430

Re: Commenting out a comment

gcc will warn you (when asked to) if it sees either a /* inside a /* */ comment or if a // comment ends a line with a backslash as both of these are likely to be programmer errors. Backslash-newline isn't a newline, it is stepped over as if it were not there effectively joining the two lines as one,...
by Paeryn
Wed Sep 05, 2018 2:29 am
Forum: C/C++
Topic: Commenting out a comment
Replies: 11
Views: 430

Re: Commenting out a comment

That's because after starting a comment with // all the characters up to the newline (but not including it) are effectively ignored. The only processing the compiler does on those characters in-between is to determine when the end of the line is reached, it never sees the start of another comment if...
by Paeryn
Tue Sep 04, 2018 11:44 am
Forum: C/C++
Topic: we are trying to use gpio pin as chip select
Replies: 18
Views: 548

Re: we are trying to use gpio pin as chip select

Hi, Thanks for Your reply,we have tried your earlier post but now we are getting another build error as in the screenshot.please help us in the same. You haven't put spaces between the filename and the two libraries so it is thinking the filename is all three strings concatenated. It should be gcc ...
by Paeryn
Mon Sep 03, 2018 9:19 pm
Forum: C/C++
Topic: C++
Replies: 3
Views: 209

Re: C++

What OS are you using, it should be installed already on Raspbian (not sure if it is for Raspbian Lite but I would have thought so). The default compiler is g++ though you can also call it with c++.

If it isn't installed it should be installable with

Code: Select all

sudo apt install g++

Go to advanced search