Source code from Video Demo

5 years 8 months ago #29530070 by beerbot
You have a video in the "Resources" section of your product description that demonstrates using the RIO API to interact with input and output devices. Can you provide the source code for that demonstration. It would help to compensate for the limited documentation on the API that is currently available.

Please Log in or Create an account to join the conversation.

5 years 8 months ago - 5 years 8 months ago #29530080 by opal
Replied by opal on topic Source code from Video Demo
Hello beerbot,

Please find a source code for the demo on your RaspberryPi file system under "/riofiles/raspio-src/rioboard_test.cpp"

I am sure you do know that, but just in case someone else will read this - the RIO-I/O files should be previously installed (see page 11 of the "RIO-xxx Datasheet" )

Regards

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29530082 by beerbot
Replied by beerbot on topic Source code from Video Demo
Hello Opal,

In the video there is a screen shot of the demonstration code. It is hard to read, but pause the video and you can see that line 30 of the code is: "cout << ", Ping= " << RioReadAnaInput(4);" There is no such line in the current rioboard_test.cpp code. In fact the RioReadAnaInput function is no longer a feature of the API and the Ping is not referenced.

Showing the setup and the operation of the Ping, as well as the potentiometers, as shown in the demo, would be helpful to understanding the API, even if the API has subsequently changed in detail. Perhaps there is an earlier version of the rioboard_test.cpp that has this code?

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29530083 by opal
Replied by opal on topic Source code from Video Demo
Hello beerbot,

You are right again - there is no such a function in the API anymore.
RioReadAnaInput(4);
got renamed to:
signed short RioReadPulseAnaInput(unsigned char ch); 				/* read analog input ch */

To my best knowledge there were some changes to the demo code somewhere around that time too. Since we encourage our customers to use the latest version of the API we release I am not sure it is a good idea that we maintain the obsolete demo code, unless it is vital for your project.

Please (if appropriate), share with us what exactly blocks you on your project and we will try our best to find the solution using the current API.

Regards

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29530084 by beerbot
Replied by beerbot on topic Source code from Video Demo
Sure...

FIRST

Opal,

Thank you for your offer of help. My project is an autonomous robot the fetches a beer for me, on request. I have it working with a different single board computer, but for a variety of reasons want to use the Pi as the brain. Your board makes that possible.

FIRST

I want to get the Ping sonar device working, like in your demo.

This requires that I:
(1) send a 2 to 5 micro-second pulse on a digital output. Do I measure the time in my code? If so is there a latency between a digital set and a digital reset that I need to account for?
(2) wait 750 micro-seconds
(3) read back a pulse width on a digital input pin. It will be between 115 micro-seconds and 18.5 micro-seconds. Does the Rio return a pulse width when it is set to pulse mode. If not how do I measure the width?
(4) wait 200 micro-seconds before the next read

SECOND

I have several I2C devices. There is an I2C library on the pi, for its pins. But I assume that the Rio supplants those pins, so do I need to write my own I2C library to access the I2C devices through the Rio digital inputs?

Please Log in or Create an account to join the conversation.

5 years 8 months ago #29530085 by roboteq
Replied by roboteq on topic Source code from Video Demo
Ping support is in the firmare. Go to the Pulse Input configuration and select Ping.

Ping interface worked at the time we did the video. It still should.

I2C is dedicated to communication with our sensors. you cannot attach anything to it

Please Log in or Create an account to join the conversation.

5 years 7 months ago #29530087 by beerbot
Replied by beerbot on topic Source code from Video Demo
Opal,

I don't see the "Ping" option, nor do I see more than one input and two outputs. Attached are the screen captures of (1) initial screen (screen-a.png), (2) the expanded input options (input-1.png, and (3) the expanded output options (output-1.png). Am I using the wrong Control Utility?

Please Log in or Create an account to join the conversation.

5 years 7 months ago - 5 years 7 months ago #29530088 by beerbot
Replied by beerbot on topic Source code from Video Demo
The png files were rejected as being too large. I see about making them smaller. What is the size limit?

Please Log in or Create an account to join the conversation.

5 years 7 months ago #29530089 by TechSupport
You can attach zipped folders with the files in it without any problems.

Please Log in or Create an account to join the conversation.

5 years 7 months ago #29530090 by beerbot
Replied by beerbot on topic Source code from Video Demo
zipped screens
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: opal
Time to create page: 0.168 seconds