Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp 1 Project Board Light an LED — Parallax Forums

Basic Stamp 1 Project Board Light an LED


Just puttering around with the Project Board.

There is no Blink an LED in Examples directory.

Is it just HIGH {pin number}?

Are Nuts and Volts articles the only lessons for Stamp 1?
«1

Comments

  • To flash an LED twice a second connected to I/O pin 5, something as simple as:
    doIt:
      HIGH 5
      PAUSE 250
      LOW 5
      PAUSE 250
      GOTO doIt
    
    Don't forget the LED series resistor (figure 10mA ... maybe 470 Ohm)

    There's an application note for the BS1 (see attached)

  • Mike

    Putting board where it is handy.

    Will get it done by dinnertime tomorrow.

    PIC says 680 ohms for LED's. Just had to put that in.(where are the darn happy face icons?)
  • ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    
    Main:
      HIGH 5
      PAUSE 250
      LOW 5
      PAUSE 250
      GOTO Main
    
  • GenetixGenetix Posts: 1,740
    edited 2017-10-12 08:21
    A higher value resistor will make the LED dimmer since it will allow less current to flow.
    680 ohms sounds like a value that would used to conserve battery power.

  • Could be about the 680 resistor.

    Could be the 1000's of devices Microchip makes.

    Some of them may put out a little more juice than others.

    Not helpful having an LED quit working when you are really trying to figure something out.

    I tracked down the USB to Serial adapter for the Project board.
  • There's some variation part-to-part in I/O pin output voltage and current as well as LED forward voltage, but that would be overwhelmed by the difference between a 470 Ohm and 680 Ohm series resistor. The color of the LED matters a lot too. Red LEDs have a forward voltage of around 1.7V. White LEDs may have a forward voltage of 3.3V and would require a series resistor of maybe 100 Ohms ... depends on the specifics of the LED. Stick with red for now. Generally an I/O pin is rated for about 20mA short circuit output, but you should normally limit that to 10mA ... There are limits on the maximum supply current you can have for the whole device ... See the datasheet for details.

  • Mike

    What size are the LED's Parallax ships?

    Sending you PM with sizes.

  • Disregard.

    They are 5mm. You measure the 'barrel' above the lip.

    Used my trusty Harbor Freight $2.99 nylon calipers.:)

    470 ohm is fine. There might be something about the board circuitry.

    Microchip 680ohm is for breadboard PIC. Direct connection.

  • Most "standard size" LEDs are 5mm.

    The BS1 Project Board already has 220 Ohm resistors in series with each of the I/O pins to protect the I/O pins from short circuits (I looked up the old product webpage). If you want a brighter LED, use a 220 Ohm resistor in series with the LED (for a total of 440 Ohms).
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-12 19:36

    Mike

    Thank you. That is a 'I never knew that!'. Actually I sort of remember it.Bouncing between all the Stamp and Propellor boards makes

    them all blur together sometimes.

    Now we're cooking with gas!

    What is input pin 'floating'? I would think that is why they are there.

    What is 'pull-up' resistor and 'pull-down' resistor?

    That is one of those items in PIC's I blew by and 'I'll deal with it later'.
  • PublisonPublison Posts: 12,366
    edited 2017-10-12 19:45


    What is 'pull-up' resistor and 'pull-down' resistor?

    https://playground.arduino.cc/CommonTopics/PullUpDownResistor

  • When you configure an I/O pin as an input (the default case with most microcontroller I/O pins), the I/O pin is essentially connected to a nearly infinite resistance that is the gate of a transistor. Since the I/O pin is not connected to any particular voltage, it's designated as "floating". Once you connect it to something that has some particular voltage, the I/O pin no longer "floats". Since a "floating" I/O pin is unstable, it's affected by static electricity fields around ... for example, bring your hand close to a floating I/O pin. If you display the value of that I/O pin, you'll see it change back and forth between 0 and 1 as you move your hand.

    A pull-up or pull-down resistor is used to provide a specific state for a floating I/O pin yet allow some other signal to change it. A pull-up resistor is tied "up" to Vcc while a pull-down resistor is tied down to Ground. The resistor often has a value somewhere between 4.7K to 100K. You might connect a switch from the I/O pin to the opposite voltage from the pull-up/down. If the switch is open, the pull-up/down sets the I/O pin state. If the switch is closed, the opposite state is set. Often a pull-up is used with the switch tied to ground. The I/O pin state is 1 for open and 0 for closed. A 100K resistor might be used where a circuit runs off batteries and the current through the resistor when the switch is closed becomes important. A low value resistor (4.7K or 10K) might be used when the switch is far from the I/O pin and you want to swamp noise on the wiring with the higher current through the resistor and switch.

  • Publison

    Where are the happy face icons please?

    I'm dismayed you have been exposing yourself to the infuences on Arduino websites.

    Arduino is anethema(something or someone that one vehemently dislikes.) to Parallax.

    I will not join you looking at such things.

    Actually waitng for Mike's take on it. Textbook definitions sometimes don't cut it with me.

  • Mike

    Thank you. Let me read that again in a couple hours and respond.

    Looks great right now.

  • What's wrong with the Arduino? ... or the Raspberry Pi for that matter? Both compete with Parallax's products as do a host of other microcontrollers. On the other hand, Parallax has tools and curriculum for education at the secondary school, junior college, and college levels. They have great support as well ... for both teachers and students. When have you seen support materials for the Arduino other than web-based that you have to find by yourself? Remember, Parallax sells an Arduino adapter for their BOEBOT chassis. Typically students building Arduino-based robots rapidly run out of Arduino processing power and they find that they have to cobble together networks of Arduinos or ... a Propeller.

  • Mike

    'You can only serve one master' Old lesson from engine building and what not.

    You get things done faster listening to one person. You can evaluate the results when it's done.

    With me it's Parallax and PIC. That's it. Can't start going 'Here, There and everywhere.'

    Yes. I will take a look at propellor.

    I think Spin is fine. No need for a Basic.
  • microcontrolleruser,

    What's a Microcontroller explains most of what you are asking about but the code is not for a BS1.

    The Arduino uses a microcontroller that is not as powerful as a Propeller but it has a lot more built-in I/O like a PIC.
    The Raspberry Pi uses a much more powerful microcontroller and since it runs Linux can be thought of as an ultra cheap PC though it's nowhere near as powerful.

    Each has its place as does the Propeller and a good designer uses the best tool needed for the job at hand.
  • Bob, you seem to like PBASIC and you're making progress.

    We have some customers who have used PBASIC extensively but fall in love with Blockly. It's not lust, but love. So much of it depends on your goals.

    How about if I send you a FLiP Module and you try some of the things on this page? http://learn.parallax.com/tutorials/language/blocklyprop

    Ken Gracey
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-12 21:35
    Ken

    Okay.Thank you.

    In Southern California we know how to 'get while the getting is good'.

    That usually means getting away here not getting something. (Where are the happy face icons?)

    Yes. I will look at Blocky Props.

  • PublisonPublison Posts: 12,366
    edited 2017-10-12 21:53
    Publison

    Where are the happy face icons please?

    I'm dismayed you have been exposing yourself to the infuences on Arduino websites.

    Arduino is anethema(something or someone that one vehemently dislikes.) to Parallax.

    I will not join you looking at such things.

    Actually waitng for Mike's take on it. Textbook definitions sometimes don't cut it with me.


    I just did a one minute Google search on Pull up Pull down. (hint..hint)
    I' m not concerned were the content comes from, as long as it's legit. I have never used an Arduino.

    As far as happy faces, there is as small face icon in the upper right of the post area. Click on that, and it will bring up all you faces.

  • Publison

    Thank you. Boy! My brain has some blank spots.

    After you post that is just the edit.

    Never thought of looking there again.

    :innocent::smile: There we go. It is icon #2.

  • What is a good way to remember what the flat side of the LED is?

    I have to go find the section in What's a microcontroller to find out.

    220 ohm resistor it is.

    The Flip kit deal fell apart in negotiations.

    Will pull out one of our Propellor boards later to take another look at Propellor.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-13 00:40
    Disregard LED question.

    Flat side is negative. Flat is like a dash or negative sign.

    Round side is positive. More than the flat side. Positive is 'more' than negative.

    I will still probably forget in about a day! :smile:

    Could somebody redo these smiley face icons please! They don't stand out much.
  • Flat side is negative. Flat is like a dash or negative sign.

    Round side is positive. More than the flat side. Positive is 'more' than negative.
    Not always! It depends on the LED. Go by the lead length: longer lead is positive.

    -Phil

  • Phil

    Thank you.

    That breadboard is too tight.

    I am just going to jumper out of pin block to half breadboard.
  • Not always! It depends on the LED. Go by the lead length: longer lead is positive.
    When in doubt, grab a meter or diode checker. I get a lot of fun parts from surplus vendors like All Electronics and I have actually purchased LEDs there that had the positive legs cut shorter (which is probably why they ended up in a surplus store).
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-14 01:01

    Jon

    I'm gotten to work on this.

    Clearing off all the breadboards of old projects

    to get one to use for this.

    Parts purchasing I have only gotten to the level of 'buy ten' when you buy a part.

    Like a 22pf capacitor for example.

  • Success!

    It all works.

    Will post picture of Basic Stamp 1 Project Board with jumpers.

  • There it is.

    Split the difference.

    Could have:

    Used board as is? No. Too crowded

    Used another breadboard next to it? No. Too many jumpers. Hard to get the VDD and VSS over to it

    without hunting down the longer jumper wires.
    2560 x 1920 - 2M
  • Very good! Now what's next?
Sign In or Register to comment.