Go to advanced search

by zer02pi
Sun Apr 02, 2017 2:49 pm
Forum: C/C++
Topic: raspberry pi - showing torrent status on lcd
Replies: 0
Views: 298

raspberry pi - showing torrent status on lcd

i use deluge on raspberry pi. can i call info(download speed, percentage etc. ) from deluge for showing them on lcd?
by zer02pi
Sun Feb 12, 2017 8:36 pm
Forum: C/C++
Topic: how can i define boolean ?
Replies: 7
Views: 2252

Re: how can i define boolean ?

AFAIK, as in C the smallest memory / data type unit is a byte, there is - other than for Pascal - actually no 1-bit C datatype "boolean", just char / unsigned char. 2nd, even if the value "false" is unique (== 0), the value of "true" is ambiguous, because any other value different from 0 will be id...
by zer02pi
Sun Feb 12, 2017 3:20 pm
Forum: C/C++
Topic: how can i define boolean ?
Replies: 7
Views: 2252

how can i define boolean ?

I try to determine output's situtaion. For example if outputs are 1000, I will do adim1 = true and other adims will be false. But when I try to build this program it says "was not declared" for adim. How can i define boolean in c++? #include "mainwindow.h" #include "ui_mainwindow.h" #include "pigpio...
by zer02pi
Wed Dec 07, 2016 4:09 pm
Forum: C/C++
Topic: Help with pigpio in QtCreator
Replies: 7
Views: 2669

Re: Help with pigpio in QtCreator

pigpio should print an explanatory message to stderr if initialisation fails. I am trying to find out how to get the output of stderr on Qt output window so i can get you the info. I have posted on the Qt forum. As soon as i can get it fixed, i will post the output i am getting here. Thanks, H- pro...
by zer02pi
Tue Dec 06, 2016 7:54 pm
Forum: C/C++
Topic: calling integer from sub window
Replies: 4
Views: 1259

Re: calling integer from sub window

This looks like the perfect time to learn about Qt Signal and Slots. http://doc.qt.io/qt-5/signalsandslots.html You could probably solve your problem with an "extern" but it just would be bad practice and result in ugly code. i looked signals and slots wiki page and some tutorial. tutorial just sho...
by zer02pi
Tue Dec 06, 2016 6:51 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

joan wrote:I can't see anything wrong.

I've used similar set-ups without problem.
may be adapter cause it. because when i supply from adapter there are more distortions and vibrations.
anyway, if it is safe to supplying servo from rp, there is no problem for me for now:)
by zer02pi
Mon Dec 05, 2016 11:41 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

We need a photo of the connections when you use the adapter. http://image.prntscr.com/image/f9f8170d649c4a2fbb4c64c1360e26b5.jpg link : http://image.prntscr.com/image/f9f8170d649c4a2fbb4c64c1360e26b5.jpg jumpers: orange - signal (phys 40 pin on rp) cyan - servo's ground black - adapter's ground whi...
by zer02pi
Mon Dec 05, 2016 11:23 pm
Forum: C/C++
Topic: calling integer from sub window
Replies: 4
Views: 1259

calling integer from sub window

i have two windows in this program. sub window (pinsettings) for just defining pins with gui. i can save these pin numbers in integers(in rp, yp, gp). but i can not call them in mainwindow. how can i use global variables in c++? btw i tried to google and find "extern int" i have added extern int top...
by zer02pi
Mon Dec 05, 2016 12:08 am
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

joan wrote:It should work then. Perhaps you just have a faulty servo.

may be. it is "tower pro mg90s" not expensive stuff. :)
i tried again supplying from adapter with same ground. it does not work. only works i supply it from rp.
by zer02pi
Sun Dec 04, 2016 11:27 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

joan wrote:That seems fine to me.

Are you sure you are using GPIO 21? GPIO 21 is connected to pin 40 on the expansion header.
yes, i used phys 40 pin.
by zer02pi
Sun Dec 04, 2016 10:47 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

If they don't have the same ground the control signal will not work. You need to connect a Pi ground to the servo ground (perhaps at the power supply -ve). yes. i have to feed from rp. thank you. :) but how can i feed it from adapter. i tried same groud, it does not work either.. It's not clear how...
by zer02pi
Sun Dec 04, 2016 10:07 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

joan wrote:If they don't have the same ground the control signal will not work. You need to connect a Pi ground to the servo ground (perhaps at the power supply -ve).
yes. i have to feed from rp. thank you. :)

but how can i feed it from adapter. i tried same groud, it does not work either..
by zer02pi
Sun Dec 04, 2016 9:47 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

Re: creating pwm /wiringpi

Have you checked the servo works? If you are running piscope you can generate servo signals with the pigs command. pigs s 21 1000 # 1000 µs pulses pigs s 21 1500 # 1500 µs pulses pigs s 21 2000 # 2000 µs pulses If it doesn't work you probably haven't connected the servo and Pi grounds. i only plug ...
by zer02pi
Sun Dec 04, 2016 9:17 pm
Forum: C/C++
Topic: creating pwm /wiringpi
Replies: 15
Views: 2720

creating pwm /wiringpi

first i do not know servo motor works or not. when i apply 5v to them (there are 2 servo which i have), they are vibrating and make a little bit noise. and when i turn motor's rotor like 90 degree, they will turn before position immediately. i use wiringpi btw. i try this: [setup] wiringPiSetupGpio(...
by zer02pi
Fri Dec 02, 2016 9:47 pm
Forum: C/C++
Topic: qtcreator + wiringpi + softpwm
Replies: 1
Views: 978

qtcreator + wiringpi + softpwm

http://image.prntscr.com/image/e41915ecac5343818036a08bc3a89394.png i want to control a led just on/off or pwm with same pin. program does not give an error, it opens normally. i tried for toggle clicked function it is end of the code. but pin does not work as on/off just works with pwm. i think i ...
by zer02pi
Thu Dec 01, 2016 7:27 pm
Forum: C/C++
Topic: running exe as root from terminal
Replies: 5
Views: 1097

Re: running exe as root from terminal

Adding option "-display :0.0" or "-display :1.0" is a possible fix. ( I believe "DISPLAY=:0.0 ; sudo ./untitled" is also a possibility ) sudo ./untitled -display :0.0 gives: No protocol specified QXcbConnection: Could not connect to display :0.0 sudo ./untitled -display :1.0 gives: Client is not au...
by zer02pi
Thu Dec 01, 2016 7:11 pm
Forum: C/C++
Topic: running exe as root from terminal
Replies: 5
Views: 1097

Re: running exe as root from terminal

when i try this:

sudo ./untitled

it says : QXcbConnection: Could not connect to display

when i try to run with qtcreator it says:
QXcbConnection: Failed to get the primary output of screen
wiringPiSetup: Must be root. (Did you forget sudo?)
by zer02pi
Thu Dec 01, 2016 6:44 pm
Forum: C/C++
Topic: running exe as root from terminal
Replies: 5
Views: 1097

running exe as root from terminal

i use rp with my laptop via ethernet. i have not screen. i wrote a gui program which controls gpio's. i have to run it as root. but when i try on sudo ./program. it says "need a screen". there was a way making exe as root and can run on vnc server. it was like that sudo chmod (some codes) ./program ...

Go to advanced search