Shop OBEX P1 Docs P2 Docs Learn Events
help with class work — Parallax Forums

help with class work

khankins513khankins513 Posts: 1
edited 2014-12-05 10:17 in Learn with BlocklyProp
This might sound like a stupid question but how do I get a LED to blink at 5hz?

Comments

  • JonnyMacJonnyMac Posts: 9,157
    edited 2014-12-04 16:16
    Do you know the formula T = 1 / F?

    Look it up. Start there.
  • ercoerco Posts: 20,257
    edited 2014-12-04 17:17
    Per Jon, 5 hz is 5 flashes per second. Pretty fast to the eye, but nothing to a microprocessor.

    Numerous ways to do this. Look up the TOGGLE command. See also PAUSE and DO/LOOP.

    Give it a shot and let us know how you make out. Easy peezy.
  • SRLMSRLM Posts: 5,045
    edited 2014-12-04 20:14
    erco wrote: »
    Numerous ways to do this. Look up the TOGGLE command. See also PAUSE and DO/LOOP.

    Although note that these are PBASIC commands, which are not applicable to PropC.
  • edited 2014-12-05 10:17
    The textbook or web guide you are working from will probably have a blinking light example activity with a circuit and program. It'll also have an explanation that a Hz is a repetition per second. That means 5 Hz would be 5 repetitions per second. If the light is supposed to blink at 5 Hz, it means that each blink has to last 1/5 of a second. Your task will be to modify the example program so that the delays or pauses for the on and off portions of each blink add up to 1/5 of a second.

    Homework assignments like this one will be a lot easier if you read the textbook/web guide you are working from, follow the instructions in the example activities carefully, build the circuits they show you, and hand enter & test the code examples. When you do end up needing help from the forums, make sure to be really specific with your question. Explain your setup carefully along with what you know up to the point you are stuck. That will help us give you a useful answer to get you over the hurdle.
Sign In or Register to comment.