Modified Ping Pasm attachment corrected
RS_Jim
Posts: 1,765
Hi,
Thanks to another thread, I discovered Ping PASM in Obex. When I downloaded it I found that it was just a demo program to demonstrate using a counter to run a Ping in a cog. I modified the PASM portion of the program to permit the use of both timers thus 2 Pings and global VARS. My thanks to Wm Dygon (pogertt@wi.rr.com) the original author of the program and JonnyMac for teaching me how to use Global Vars.
I will attach the Archive file to this post when I figure out how to do it!
Thanks to another thread, I discovered Ping PASM in Obex. When I downloaded it I found that it was just a demo program to demonstrate using a counter to run a Ping in a cog. I modified the PASM portion of the program to permit the use of both timers thus 2 Pings and global VARS. My thanks to Wm Dygon (pogertt@wi.rr.com) the original author of the program and JonnyMac for teaching me how to use Global Vars.
I will attach the Archive file to this post when I figure out how to do it!
Comments
lets try to attach that archive file.
Let me know what you think?
Jim
Jim
Pings are really easy to use. The Propeller waitpxx are very precise so you don't really need to use PASM to read the sensor (nor does it hurt to use PASM).
I modified the Ping program which comes with the Propeller Tool to compensate for temperature.
Here's a link to my version.
http://forums.parallax.com/discussion/158541/ping-object-with-temperature-compensation-and-more
The main thing to keep mind is not to trigger multiple Pings at the same time. If more than one Ping is triggered, the echo from one sensor will interfere with the other.
Jim,
If you're still monitoring the forum I'm curious about the program you posted. I the top post you mention using a PASM version of the code but when I downloaded the version attached above, it looks a lot like the code in the Propeller Library. Did you decide not to use the PASM version?
I am still around. Can't get to a windows computer for several days to check the code I posted. What I did was take the Obex version of PingPasm and added a second counter. Using the Pings in this way allows two pings to be run together in 1 cog and not interfere with each other. With the Spin version of Ping, the code uses waitPNE, waitPEQ and will hang if one ping fails to respond. My version is a very subtile modification of the PingPasm from obex that uses the second counter and either Ping can be disconnected without hanging up the program. Check my program and compare it with Ping Pasm from Obex and I believe that you will find less than ten lines of code different.
If you run the comparison and find no difference, let me know and I will look at it first opportunity I can get on my WIN computer. Can't check it from the iPad. Ran the Pings close together, pointed in different directions, and did not observe any interference problems.
Jim
I think you may have uploaded the wrong demo code. The code you attached above using the normal Ping object with the waitpeq statement.
If you can find your PASM demo, I'm interested in seeing it.
Jim
Jim
Is it right this time?
Jim
jim
The original Eddie firmware triggered all the Ping sensors at once. I noticed the two Ping sensors I used to test the code had a lot of interference from each other. I modified the Eddie code to trigger the Pings one after the other which eliminated the noise issue.
I really like the idea of not worrying about Ping code getting hung up waiting for a pin change but I think the code, as it is, will cause interference if the two Ping sensors are close to each other.