Go to advanced search

by Mahan_Micro
Mon Oct 24, 2016 6:51 am
Forum: Beginners
Topic: Help for using Qextserialport LIB
Replies: 0
Views: 328

Help for using Qextserialport LIB

HI
I want to use a good library in QT4 for serial port programming in RPI2
some people say you can use qextserialport
I download a lib with this name and add to my project but it has many error
is there any one who tests this LIB and give me the lib code ???
by Mahan_Micro
Mon Oct 03, 2016 8:31 pm
Forum: C/C++
Topic: my problem with QT and TextBrowser
Replies: 2
Views: 646

my problem with QT and TextBrowser

Hi I have a form in QTcreator and I use serial port of RPI2. I don't use any library like wiring pi, I write my code by linux file read/write function. I can send any char by serial port,open and close port and... I have a TextBrowser in my form and I want to show recieving buffer of serial port on ...
by Mahan_Micro
Sun Oct 02, 2016 8:19 am
Forum: C/C++
Topic: closing serial port in QT
Replies: 3
Views: 1063

Re: closing serial port in QT

I have another problem,If you can please help me : I have a TextBrowser in my form and I want to show recieving buffer of serial port on it I want a function that check the serial port for recieving always and show the recieving in textbrowser (like a serial terminal) I can recieve 10 char in a simp...
by Mahan_Micro
Sat Oct 01, 2016 12:25 pm
Forum: C/C++
Topic: closing serial port in QT
Replies: 3
Views: 1063

Re: closing serial port in QT

scotty101 wrote:Don't directly call the close function with a button press.

Create a separate function that contains the close(fd) and call that.
Thanks a lot ! :) :) :)
by Mahan_Micro
Sat Oct 01, 2016 7:07 am
Forum: C/C++
Topic: closing serial port in QT
Replies: 3
Views: 1063

closing serial port in QT

HI I am designing a GUI with QTcreator and I need to use Serial port on PI2. I don't use any library and I write my code only with linux file function. for example I have a buttom that opens the Serial Port : int fd= open (...) if (fd < 0) .. else... .... I want another buttom that close the port af...
by Mahan_Micro
Mon Sep 26, 2016 1:38 pm
Forum: C/C++
Topic: interrupt for serial port recieving
Replies: 6
Views: 1710

Re: interrupt for serial port recieving

topguy wrote:Are you actually using Qt or just QtCreator as an IDE for C/C++ ?

Any guide on pthreads will be suitable.
I use QTcreator as an IDE
thanks a lot
by Mahan_Micro
Sun Sep 25, 2016 6:52 pm
Forum: C/C++
Topic: interrupt for serial port recieving
Replies: 6
Views: 1710

Re: interrupt for serial port recieving

If you want your program to do stuff and not be busy listening to the serial port all the time I would suggest looking into multithreading. Let the kernel deal with low-level stuff like interrupts unless you need response times measured in nanoseconds. thank you, you are right do yo know any tutori...
by Mahan_Micro
Sat Sep 24, 2016 8:30 pm
Forum: C/C++
Topic: interrupt for serial port recieving
Replies: 6
Views: 1710

Re: interrupt for serial port recieving

joan wrote:Look at the select, poll, and epoll functions.
thanks
can you give me a good link or tutorial ??
by Mahan_Micro
Sat Sep 24, 2016 2:26 pm
Forum: C/C++
Topic: interrupt for serial port recieving
Replies: 6
Views: 1710

interrupt for serial port recieving

Hi I want to use serial port in pi2 and I write my code in C and working with virtual file in linux. so I dont need to other library. I can send and recieve in serial port but I dont know how I can use interrupt for recieving ??? I want to run a sub function(interrupt) when a 'char' recieved ! can y...
by Mahan_Micro
Sat Sep 17, 2016 3:28 pm
Forum: Beginners
Topic: changing PI password as root
Replies: 6
Views: 1293

Re: changing PI password as root

Mension1234 wrote: Do you mean it's booting to the command line? Or it's just without the folders you had?
IT has a GUI when boot as ROOT, and I dont have my folders even login with PI
by Mahan_Micro
Wed Sep 14, 2016 6:15 am
Forum: Beginners
Topic: changing PI password as root
Replies: 6
Views: 1293

Re: changing PI password as root

Try entering this in the command line: su - pi If it prompts you for a password, the default one is 'raspberry' Try taking a look at this thread as well: https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=25345 thanks a lot dear friend ! now I can login as PI but I have new problem : 1_after e...
by Mahan_Micro
Tue Sep 13, 2016 7:09 am
Forum: Beginners
Topic: changing PI password as root
Replies: 6
Views: 1293

changing PI password as root

Hi
I could install the NODE-RED on RPI2 (raspbian) and reboot it.
after installing, my RPI bootup as root and I dont have any access to my software and... that ready for PI user
I can't Enter with PI and it's password.
can you help me?
I want to Enter as PI user but I dont know how !?!??
by Mahan_Micro
Mon Apr 18, 2016 7:26 am
Forum: Beginners
Topic: GPIO Permission In QT
Replies: 6
Views: 1286

Re: GPIO Permission In QT

I write these commands in terminal : (test is my project name)

Code: Select all

sudo chown root:root test
sudo chmod u+s test
./test
program runs and my form apear but there is no object on it (push button , text box and...) ! :(

I don't know how I can fix it :roll:
by Mahan_Micro
Thu Apr 07, 2016 8:30 pm
Forum: Beginners
Topic: GPIO Permission In QT
Replies: 6
Views: 1286

Re: GPIO Permission In QT

DirkS wrote:
Mahan_Micro wrote:Who Can Help Me ?????? :?: :?: :?:
Patience please. Forum members are volunteers and some even have to work for a living.
Give it some time...
Excuse me , You are right
by Mahan_Micro
Thu Apr 07, 2016 1:25 pm
Forum: Beginners
Topic: GPIO Permission In QT
Replies: 6
Views: 1286

Re: GPIO Permission In QT

Who Can Help Me ?????? :?: :?: :?:
by Mahan_Micro
Thu Apr 07, 2016 8:21 am
Forum: Beginners
Topic: GPIO Permission In QT
Replies: 6
Views: 1286

GPIO Permission In QT

Hi
I create a project in QTcreator and I want to Turn on And Off a LED
I use bcm2835 library
when I run This project I see following error :
bcm2835_init: unable to open /dev/mem :permission denied :cry:


how I can fix this problem ?? I want to acces GPIO
by Mahan_Micro
Tue Mar 29, 2016 6:56 am
Forum: Other languages
Topic: آموزش رزبری پای
Replies: 37
Views: 43899

Re: آموزش رزبری پای

ایول
ممنون بابت مطالب خوبی که گذاشتین
ایشالا اینجا هم دور همی بترکونیم ! :D
by Mahan_Micro
Tue Sep 29, 2015 6:48 am
Forum: Beginners
Topic: problem with Serial
Replies: 6
Views: 1863

Re: problem with Serial

I change the code and have not syntax error but I have another error my simple code is: import serial import os ser=serial.Serial('/dev/ttyAMA0',115200) ser.write ('Mahan') and when I run it : Traceback (most recent call last): File "/home/pi/test.py", line 5, in <module> ser.write ('Mahan') File "/...
by Mahan_Micro
Thu Sep 24, 2015 5:36 am
Forum: Beginners
Topic: problem with Serial
Replies: 6
Views: 1863

Re: problem with Serial

this is my code: import serial port = serial.Serial("/dev/ttyAMA0", baudrate=115200, timeout=3.0) while True: port.write("\r\nSay something:") rcv = port.read(10) port.write("\r\nYou sent:" + repr(rcv)) there is no error message.I have a syntax error when I run the code, a Syntax error apear,because...
by Mahan_Micro
Wed Sep 23, 2015 7:14 pm
Forum: Beginners
Topic: problem with Serial
Replies: 6
Views: 1863

problem with Serial

Hi I want to send and recieve by serial port but in python when I type following code: import serial port = serial.Serial("/dev/ttyAMA0", baudrate=115200, timeout=3.0) while True: port.write("\r\nSay something:") rcv = port.read(10) port.write("\r\nYou sent:" + repr(rcv)) it has one Syntax error in ...
by Mahan_Micro
Thu Sep 10, 2015 8:45 pm
Forum: Beginners
Topic: my simple program in GEANY
Replies: 4
Views: 889

Re: my simple program in GEANY

ise there any idea for my problem??
my gpio is right , with python I test it but in C don't work !!
by Mahan_Micro
Tue Sep 08, 2015 9:09 am
Forum: Beginners
Topic: my simple program in GEANY
Replies: 4
Views: 889

Re: my simple program in GEANY

Perhaps try this: #include <bcm2835.h> int main(int argc,char **argv){ if (!bcm2835_init()) return 1; bcm2835_gpio_fsel(18,BCM2835_GPIO_FSEL_OUTP); while(1) { // bcm2835_gpio_set(18); bcm2835_gpio_write(18, 1); } } Not sure why you code the while forever loop, you could do without in this sample. S...
by Mahan_Micro
Tue Sep 08, 2015 5:54 am
Forum: Beginners
Topic: my simple program in GEANY
Replies: 4
Views: 889

my simple program in GEANY

Hi I write a simple code that only turns on an LED for me by C in geany this is my code: #include <bcm2835.h> int main(int argc,char **argv){ if (!bcm2835_init()) return 1; bcm2835_gpio_fsel(18,BCM2835_GPIO_FSEL_OUTP); while(1){ bcm2835_gpio_set(18); } } there is no error in compile and build but wh...
by Mahan_Micro
Sat Sep 05, 2015 4:22 pm
Forum: Python
Topic: my problem with pygame EVENT !
Replies: 8
Views: 2687

Re: my problem with pygame EVENT !

elParaguayo wrote:You need to take far more care over your typing. Look at what I wrote:

Code: Select all

if event.key == pygame.K_UP:
That is not the same as you've got written.

You'll see the error when you press any key because your script needs to check if any of your if statements are satisfied.
Thanks a lot :) :) :)
by Mahan_Micro
Fri Sep 04, 2015 6:32 pm
Forum: Python
Topic: my problem with pygame EVENT !
Replies: 8
Views: 2687

Re: my problem with pygame EVENT !

This is my error:

Code: Select all

Traceback (most recent call last):
  File "/home/pi/Desktop/game2.py", line 75, in <module>
    if event.key == pygame.K_Up:
AttributeError: 'module' object has no attribute 'K_Up'
I see this error when any key i press (any key :!: )

Go to advanced search