Shop OBEX P1 Docs P2 Docs Learn Events
NEWBIE, Writing a program that reads resistance or voltage values. — Parallax Forums

NEWBIE, Writing a program that reads resistance or voltage values.

Frank FernandezFrank Fernandez Posts: 12
edited 2013-02-26 15:08 in BASIC Stamp
Hi all,thanks for having me, although I have a degree from De'Vry university from the mid 80's it was just a tech degree. I fully understand board level compoenets but am completely dirt poor in programming. So I'm a total newbie here but have been wanting to to this for years. I have the basic stamp educational kit and have run thru the lessons. Now I want to start developing my own toys.

What I need to do is write a program that see's either varying resistance and or voltage values that I can draw from to enact certain functions.

Sorry for what I assume is a silly question but I have to start somewhere.

Thank you in advance.

Comments

  • ercoerco Posts: 20,257
    edited 2013-02-17 14:36
    Sure, you can use the RCtime function easily to measure various resistances easily, and voltages with a little more work.

    Check out RCTIME and report back, soldier! :)
  • davejamesdavejames Posts: 4,047
    edited 2013-02-17 14:40
    ...welcome Frank.

    Another DeVry alumni? Which location?

    I attended in Phoenix, '70 - '73.
  • Frank FernandezFrank Fernandez Posts: 12
    edited 2013-02-17 14:43
    Thank you, reading up on that command now.
  • Frank FernandezFrank Fernandez Posts: 12
    edited 2013-02-17 14:45
    The old Woodbridge NJ campus from 86-88, It's a mall now like we need more of those. They moved the campus further north Jersey, not sure where.
  • Frank FernandezFrank Fernandez Posts: 12
    edited 2013-02-17 14:52
    Calling ERCO,

    Did a fast search and found this article- http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv15.pdf

    Extremely concise and well written. Thanks for the lead.
  • ercoerco Posts: 20,257
    edited 2013-02-18 09:09
    Well done, FF. Also have a peek at Stamp guru Tracy Allen's most excellent info at http://emesystems.com/BS2rct.htm

    There is a wealth of info on that site, surf around. And let us know how your foray into Stamps & programming goes.

    Finally, welcome to the forums!
  • playinmyblues_nsccplayinmyblues_nscc Posts: 38
    edited 2013-02-18 15:02
    Hi Frank. Programming is a lot of fun and it is good to hear you will be making fun stuff. There are lots of different manuals available from Parallax. "What's a Microcontroller" and "StampWorks" are two very good ones. If you look at the Parallax store and check out some of the manuals/books you will see they are free for download. Just make sure to check the listing for components for the whole book and for each project if you intend to go step-by-step.

    Nuts and Volts, the magazine also has lots of good articles and you will also find them available on the Parallax website. My latest project uses the RCTIME instruction. You can check it out here:
    http://forums.parallax.com/showthread.php/144865-Luna-Mod-Looper-Basic-Stamp-2-Version

    Good luck and let us know what you are making.

    Speaking of making, check out Make magazine.
  • Frank FernandezFrank Fernandez Posts: 12
    edited 2013-02-23 07:51
    Thanks for all the support everyone, i finally have the time to move forward on these projects once and for all. What I'm working on is a low cost cotroller to oprate the rudimentary function of semi-electonic automatic overdrive transmissions. The purpose of this is to give the automotive performance aftermarket a viable option for swapping overdrive transmissions into earlier model vehicles. I've tried to hire programmers in the past but financing never allowed for it.

    Question, Devry gives online courses in BASIC programming. Is anyone familiar with it and is it worth the tme and cost ?
  • playinmyblues_nsccplayinmyblues_nscc Posts: 38
    edited 2013-02-26 12:00
    While I cannot say that the Basic Stamp 2 is not capable of such a task I think that there are probably better uCs available to do this job. From what I have read so far and my experience with other uCs, applications that require precise timing need something called the ability to interrupt. Somebody else please chime in here because I know very little on the subject! Anyway, the BS2 will only perform one task at a time. Yes, there are times where the BS2 will drive an LED high and leave it and go do something else but the instructions require that the program cycle around again to execute the next possibility. Other uCs can "interrupt" the flow of the program in the middle and have the process do something else then go back to what it was doing before the interrupt.

    My current project actually demonstrates this type of operation. Here is the link on this forum: http://forums.parallax.com/showthread.php/144865-Luna-Mod-Looper-Basic-Stamp-2-Version
    Here is the latest YouTube video: http://www.youtube.com/watch?v=1YoIxKOQcE0

    You can download the code for the Luna Mod Looper Basic Stamp 2 version at the MediaFire link. Once you open the file you can go the different instances where the <GOSUB Get_Tempo> subroutine is called. It first appears on line 165. The point is that while other better suited uCs will allow you to change the value of tempo by the turning the tempo pot at any time, with the BS2, you have to wait until the program cycles around to read the value of the pot. Looking at the videos will show that there are times when I change the tempo pot and, especially if the tempo is slow, the last note played can be seen to fully execute before the tempo changes.

    Once you have some experience with the BS2 and if it is not fast enough, I suggest getting a Propeller uC. The Propeller Quickstart is very affordable and the PDFs are free. As I said, somebody else will have a lot more experience so keep asking.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-02-26 12:28
    The Propeller does not have interrupts (very deliberately so!) and has no problem with applications that require very precise timing (on the order of tens of nanoseconds). Most mechanical devices (like an overdrive transmission) operate slowly enough that something like a Stamp is more than capable of the tasks involved as long as you don't expect the Stamp to do more than one operation at a time ... like continuously computing RPM by counting shaft revolutions using a magnet and Hall-effect sensor as well as doing something else ... sampling RPM briefly a few times a second would work, but not continuously monitoring it.
  • Frank FernandezFrank Fernandez Posts: 12
    edited 2013-02-26 15:08
    I agree, The Prop chip is the better way to go long term once I've become a bit more seasoned in progrmming in general. The BS2 stamp as you stated for such a slow acting (milliseconds in mind here) deice such as transmission will do just fine. But for anything that requires LOGIC the stamp simply will not do.Thats the overall goal once I've gotten beyond my base needs.

    Thank you again, your comments were very concise and eloquent, I appreciate your time and effort.


    As a side note, I am a seasoned mechanical and production systems robotics engineer. My shortcoming has always been my limiting myself to the mechanical end where the programming end has always escaped me.If you ever have an idea or concept you would like to collaborative upon I'd appreciate your time.
Sign In or Register to comment.