Jump to content
Sign in to follow this  
jim

QT and arduino GPIO, ADC, SPI, Wire

Recommended Posts

Hey!

Not tried in C++ but maybe you can try to port needed funcs to C++ class? c_envrionnement is like C++(some base code is in C, others in C++) it should be easier to adapt it to pure C++. For examplen i've ported rcswitch from arduino libs to pcduino in C(to avoid linking with c_environnement)...

See https://github.com/pcduino/c_environment to show how code is organized...

Greets,
Alex.

Share this post


Link to post
Share on other sites

hey!

Porting serial class should be easy, in qt documentation you'll found all your needs(http://qt-project.org/doc/qt-5/qtserialport-index.html) If you need a sample code in C I can send u my own code to opening serial port and talking with it...

Porting adc, should be easier since you can found pwm sample 
https://github.com/pcduino/c_environment/blob/master/sample/pwm_test.c

It uses:
https://github.com/pcduino/c_environment/blob/master/hardware/arduino/cores/arduino/wiring_analog.c

you need to port C code to C++ or mix code

Porting SPI is little more complex, since if you use pcduino v1/v2 spidev module need to use hardware spi bus print a lot of kernel message(printk stuff) and slowing spi communication! You will not be able to compile a spi patched kernel since customized kernel 3.4.29+ refuse to boot!  angry.gif you can try to implement software SPI bitbanging. But in some case software SPI is't useless(TFT...)

Greets,

Share this post


Link to post
Share on other sites

I2C ported, OLED 1602 Display i2c lib added.
SPI ported, TFT on RA8875 in SPI mode added.
See spi signal by logic analyze, big time between transfer, irrespective of the transmission speed
and CS signal very wide.
for serial no time, later. 
I use PcDuino3.
How I can use IR?
were i can find libs for IR and examples?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×