Lynxmotion Tech Support

www.lynxmotion.com
It is currently Mon May 20, 2013 7:49 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Basic stamp 2 programing
PostPosted: Sat Sep 08, 2007 6:15 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
can somebody help me write the program for the following:

In order to measure variable quantities, the BASIC Stamp utilizes the software command
RCTime. RCTime relies on the charge/discharge behavior of a resistor-capacitor pair to indicate
the relative value of the variable quantity. In most of our applications, a fixed capacitor is used
with a variable resistance device. Many electrical sensors/transducers change resistance in
response to an external stimulus. You will be introduced to these types of devices which include
thermistors, RTD's (resistive temperature device), strain gages, and photocells in future
experiments. Alternately, if there was a variable capacitance (a humidity sensor is an example)
device used to sense a quantity, a fixed resistor would be utilized to produce a decay rate that
would be compatible with the BASIC Stamp.
Experiment 1b: Identify and select the Cadmium-Sulfide (CdS) photocell. The specifications
indicate that the dark resistance is approximately 20 MW, while the light resistance is less than
1kW. Use a 1 KW resistor and a 1.0 μF capacitor along with the photocell. Note, the capacitors
that you have in your kit are either disc or tantalum capacitors. Their capacitance is written on
the body of the device. They should have either a 104 or 105 marked on the units. The 104
stands for 10 X 104 picofarads or 0.1 μF. Please refer to the RCTIME command reference to
calculate values of R and C for other applications. Using the RCTime and DEBUG commands,
write a short program to read the output from the photocell and then output the value to the
debug screen to read. Once the program is running, cover the photocell with your hand and note
the change in the display value. If necessary, modify the program so that lower numbers are
displayed under dark conditions and higher numbers under light conditions. Please note that the
display will be in integers only, ranging from 0 to 65535. The RCTime variable should be in the
range from 5,000 to 65,000. Adjust the component values to bring the variable value into
specification.


if you can, please help me

hcein


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 6:55 pm 
Offline
Robot Guru

Joined: Thu Jul 13, 2006 10:10 pm
Posts: 2225
Sounds like homework (fall classes have started). If it is homework, you are probably paying an instructor good $$$ to explain these things to you, so ask the instructor first to get some of your investment back. Also, the "Use a 1 KW resistor...) indicates someone probably didn't proof read their instructions. If it isn't homework, then what have you tried so far to solve the problem?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 7:19 pm 
Offline
Robot Guru
User avatar

Joined: Mon Oct 31, 2005 3:03 pm
Posts: 3598
Location: Houston, Texas
Do you have a stamp board? Per the instructions, it sounds like you were given parts to perform this assignment. Like zoomcat said, get your moneys worth and ask the teacher to explain any grey areas and at the very least try it your self.

_________________
Mike

The robotics nut.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 08, 2007 11:04 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
of course it's homework; if i were able to do it i wouldn't search for help over the internet guys!!! and i asked the teacher and what he explained didn't really make sense so i had no choice to try here since nobody wants to have a zero on an assignment, i had to ask for help before givin up,

I've been trying this homework for 2 weeks now


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 12:33 am 
Offline
Robot Guru

Joined: Thu Jul 13, 2006 10:10 pm
Posts: 2225
So post up some of the code or info on what you have been trying for two weeks that isn't working. You will probably need to demonstrate that you have been making some effort yourself to resolve the issue before people will spend their effort to figure it out for you.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 7:52 am 
Offline
Robot Guru
User avatar

Joined: Mon Oct 31, 2005 3:03 pm
Posts: 3598
Location: Houston, Texas
Not to be rude but two weeks of research on the internet would have explained enough about the subject so that you would be able to understand. There are examples all over the place and all you would need to do is try one example and see for your self how it works.

You never even answered my question: Do you even have a stamp board?

I don't think anyone on this forum is going to do the work for you without some evidence that you at least tried to learn this on your own.

_________________
Mike

The robotics nut.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 3:31 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
here's what i did:

CdS CON 0

light VAR Word
Loop:
LOW CdS
PAUSE 1
RCTIME CdS,0,light
DEBUG Home,DEC5 light,CR
PAUSE 100
GOTO Loop

When i cover the CDS cell with my finger, the output is still the same, it doesn't detect when i cover it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 3:42 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
yes i have a stamp board; and i don't really want you to do the homework for me, all i am asking is some help. i should have posted the work i did since the begining, you're right, i just wanna know if somethig is wrong with what i programmed so far coz it ain't workin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:19 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
hello i figured out my problem

CdS CON 0

light VAR Word
DO
LOW CdS
PAUSE 1
RCTIME CdS,0,light
DEBUG Home,DEC5 light,CR
PAUSE 100
Loop

this works, when i run it it gives me a big value, and when i cover the photocell it returns 0. that works.

and thanks for trying to help me


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:35 pm 
Offline
Robot Guru
User avatar

Joined: Mon Oct 31, 2005 3:03 pm
Posts: 3598
Location: Houston, Texas
hcein wrote:
hello i figured out my problem

CdS CON 0

light VAR Word
DO
LOW CdS
PAUSE 1
RCTIME CdS,0,light
DEBUG Home,DEC5 light,CR
PAUSE 100
Loop

this works, when i run it it gives me a big value, and when i cover the photocell it returns 0. that works.

and thanks for trying to help me


Glad you figured it out! You learned more by figuring out what you did wrong on your own than if we just pointed it out. If you go to the Parallax website, they have tons of information about this sort of stuff for the future.

I have to give you a lot of credit for figuring it out because this stuff aint easy when you don't know whats going on in the beginning. We have all been there before. Quick advice for the future; if you post as much information upfront, such as your current code, results, problems and even a link to a photo, members would help as much as they can.

here's a link to Parallax.com a great place for tons of information:

www.parallax.com

Here is a link to another site that explains more about this topic:

http://www.utc.edu/Faculty/Tatiana-Allen/rctime.html

_________________
Mike

The robotics nut.


Last edited by SN96 on Sun Sep 09, 2007 4:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:37 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
thanks a lot man


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:47 pm 
Offline
Robot Guru
User avatar

Joined: Mon Oct 31, 2005 3:03 pm
Posts: 3598
Location: Houston, Texas
Here is another simple program that displays the results to the debug window:

Code:
result  VAR     Word

Test:
  HIGH 7                                ' charge the cap
  PAUSE 1                               '   for 1 ms
  RCTIME 7, 1, result                   ' measure RC discharge time
  DEBUG DEC ? result                    ' display result
  END



I got this right out of the Stamp program software also known as the IDE (interface development environment).

When you are in the Stamp IDE, press F1 and a help file will open you can do a search for "RC Time" and that is how I found this example code.

_________________
Mike

The robotics nut.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:52 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
yeah i got that one too;

thanks for the help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 4:53 pm 
Offline
Robot Guru
User avatar

Joined: Mon Oct 31, 2005 3:03 pm
Posts: 3598
Location: Houston, Texas
And here is the example that they gave in the same help topic:

Image

_________________
Mike

The robotics nut.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 09, 2007 5:32 pm 
Offline
Roboteer

Joined: Sat Sep 08, 2007 5:53 pm
Posts: 11
yeah got that too am using this program

CdS CON 0
light VAR Word
DO
LOW CdS
PAUSE 1
RCTIME CdS,0,light
DEBUG HOME,DEC5 light,CR
PAUSE 100
LOOP

when i run it it returns 0 under light and when i cover the cell with my hand the value increases.

my problem now is how to make it do the contrary: i mean:

how to make it return 0 under dark and high number under light


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group