Homework Help
larperdoodle
Posts: 4
I missed the week where we went over this, but now have to complete a homework assignment. I managed to answer most of the questions, but a few are remaining.
The only related knowledge I have is a bit of Java. Pretty useless, huh.
1. The BASIC program shown below is intended to turn a servo for how long (in seconds)?
FOR counter = 1 to 180
PULSOUT 13, 850
PAUSE 30
NEXT
The answer should be 30*180=5400ms=5.4 seconds, possibly figuring in the delay from the PULSOUT. First of all, I'm not actually sure which units these delays are in...
2. A BASIC Stamp integrated circuit will only work if the proper voltage is supplied. On the Boe-bot this is accomplished by a voltage regulator, but on the prototype board (breadboard), you will have to reduce the voltage yourself.
(a) Calculate the voltage drop required for a battery source of 20 volts.
(b) If 0.007 amps of current are needed by the BASIC Stamp, how many 22 ohm resistors would accomplish the voltage drop?
I really have no idea where to start.
3. A BASIC program is written to control an infra-red sensor, the command line is
FREQOUT 2, 1, 49400
(a) What is the frequency of the first signal?
(b) What is the value of the second frequency?
Not sure where to start on this one either. I get that the 2, 1, 49400 are modifiers of the FREQOUT method, but I don't know what any of them mean.
Help me as little or as much as you want to, I will even appreciate hints. ;P
The only related knowledge I have is a bit of Java. Pretty useless, huh.
1. The BASIC program shown below is intended to turn a servo for how long (in seconds)?
FOR counter = 1 to 180
PULSOUT 13, 850
PAUSE 30
NEXT
The answer should be 30*180=5400ms=5.4 seconds, possibly figuring in the delay from the PULSOUT. First of all, I'm not actually sure which units these delays are in...
2. A BASIC Stamp integrated circuit will only work if the proper voltage is supplied. On the Boe-bot this is accomplished by a voltage regulator, but on the prototype board (breadboard), you will have to reduce the voltage yourself.
(a) Calculate the voltage drop required for a battery source of 20 volts.
(b) If 0.007 amps of current are needed by the BASIC Stamp, how many 22 ohm resistors would accomplish the voltage drop?
I really have no idea where to start.
3. A BASIC program is written to control an infra-red sensor, the command line is
FREQOUT 2, 1, 49400
(a) What is the frequency of the first signal?
(b) What is the value of the second frequency?
Not sure where to start on this one either. I get that the 2, 1, 49400 are modifiers of the FREQOUT method, but I don't know what any of them mean.
Help me as little or as much as you want to, I will even appreciate hints. ;P
Comments
#2: Ohm's Law will help you figure this out. The Wikipedia has some nice pages on the subject.
#3: Look in the "IR Remote for the BoeBot Robot" tutorial for information on IR control with the FREQOUT statement. Also look in the Stamp Reference Manual for more FREQOUT description.
Since this is a homework assignment, you're mostly on your own, but these references will help you out.
http://www.parallax.com/dl/docs/prod/stamps/basicstampman.pdf
But, if you just want feedback on your work, then we can help.
1. Take a look at the Basic Stamp Reference Manual, under the PAUSE command and under the PULSOUT command. These will tell you how long things take (roughly) and their units. http://www.parallax.com/dl/docs/prod/stamps/basicstampman.pdf
2. A side comment: the Basic Stamp has an onboard regulator, but it only works up to 15v. Anyway, take a look at the product page, and see what voltage the stamp runs at. Subtract that from 20, and you get the needed voltage drop. Then, you use Ohm's law to figure the total resistance needed to get that drop.
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/CategoryID/9/List/0/SortField/0/Level/a/ProductID/1/Default.aspx
3. Again, look at the manual (under FREQUOUT).
The format of FREQOUT is FREQOUT pin, period, freq1, freq2. But freq2 is not specified in the problem, only freq1. Can somebody clarify how the second frequency is determined or derived from freq1
Now I'm stuck on another problem. I thought I knew how to do it, but I can't get it to give the right answer...
250*(850/500,000)= .425 seconds
250*15 = 3750 milliseconds = 3.75 seconds
.425+3.75=4.175 seconds
This is a practice problem where it tells me the answer is 4.5
Where 850 is the PULSOUT value, 15 is the PAUSE value, and 250 is the counter.