Shop OBEX P1 Docs P2 Docs Learn Events
Homework Help — Parallax Forums

Homework Help

larperdoodlelarperdoodle Posts: 4
edited 2013-05-12 13:04 in BASIC Stamp
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-11 20:16
    #1: You need to look in the "Basic Stamp Syntax and Reference Manual" in the chapters on the PULSOUT and PAUSE statements.

    #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.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-05-11 20:17
    Maybe have a look at the Basic Stamp manual? For example FREQOUT is on page 187.

    http://www.parallax.com/dl/docs/prod/stamps/basicstampman.pdf
  • larperdoodlelarperdoodle Posts: 4
    edited 2013-05-11 20:18
    Thanks! I don't mind reading.
  • SRLMSRLM Posts: 5,045
    edited 2013-05-11 20:19
    Generally, we don't answer homework questions for students. If that's what you wanted, you'll have to look elsewhere.

    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).
  • SRLMSRLM Posts: 5,045
    edited 2013-05-11 20:20
    Yay! 3 answers in 3 minutes!
  • larperdoodlelarperdoodle Posts: 4
    edited 2013-05-12 10:41
    Mike Green wrote: »
    #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.
    Ok, so I read and found out that the red number is in hz, so I converted to khz and got part 1 of that question right. But I'm not sure, even after reading, how to find the second frequency, as it isn't specified. I can do practice problems and have been trying with those. When the frequency of the first signal is 54 the value of the second frequency is 11.5. When the first is 45.3 the second is 20.2. I have not been able to find a relation between these two.
    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
  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-12 10:56
    Read starting at page 239 of the "Robotics with the BoeBot" tutorial. This explains how you get two frequencies from one number. Sorry, I pointed you to "IR Remote for the BoeBot Robot" first.
  • larperdoodlelarperdoodle Posts: 4
    edited 2013-05-12 11:58
    Thanks, I read that and it worked :D
    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.
  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-12 13:04
    Chapter 1, "Introduction to the Basic Stamp" in the "Basic Stamp Syntax and Reference Manual" describes the allowed voltage range for each of the Stamp modules. The Stamp modules have their own voltage regulators and also allow you to supply a regulated voltage in place of the built-in regulator. It depends on where you connect the power source. Look at the pin descriptions later in Chapter 1 for what's allowed.
Sign In or Register to comment.