Shop OBEX P1 Docs P2 Docs Learn Events
Can microcontroller count objects?? — Parallax Forums

Can microcontroller count objects??

AydaAyda Posts: 1
edited 2004-10-25 18:12 in Learn with BlocklyProp
Hello...

·I'm new in microcontroller. I'm doing a project using microcontroller for my final year project. I wanted the microcontroller to count up to 15 before it can trigger a solenoid valve to execute the work intended. I faced a problem in making the controller to do that. The solenoid valve is triggered even if its only count up to 1 or 2.I don't want this. Can microcontroller do this job or not? Can it count? I mean counting objects, not time. Or do·I need to use an interface for it?

·Thanks..

·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-22 04:06
    Yes, this is a very easy task for even the simplest of microcontrollers. The idea is this:

    A. Wait until you see an object
    B. Wait until object goes away
    C. Add 1 to count
    D. Go back to A

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • glasoglaso Posts: 38
    edited 2004-10-22 11:40
    You have to create a variable (i.e x) then when you see the object you can say x=x+1 and so on with the other object.

    To trigger the solenoid valve you need a condition like this:

    if x=15 then goto trigger_valve

    where trigger valve is a routine in the program which trigger the solenoid valve
  • Kenny LevinsenKenny Levinsen Posts: 19
    edited 2004-10-23 21:20
    hi im new with robotics(NOT with electronic!)i go in 7th grade and are 12 year,

    so you would be pleased if you kan give me some REALLY low cost ideas.

    i get 380dkk(im danish(to do dollar to dkk you should multipliced it with 6,5 and then plus 25%, and then plus 70 for import)at month an i get MAX 2000dkk in birthday and cristmas.

    PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!sad.gif
  • Kenny LevinsenKenny Levinsen Posts: 19
    edited 2004-10-23 21:23
    hi it's me again im stil being teached by my onkel so don't give psyko pbasic2.5 kodes or diagrams!
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2004-10-25 18:12
    Kid,

    Please explain what you are looking for.

    Low cost ideas for robotics? A low cost robot? A low-cost microcontroller? Low cost sensor? Everything?

    Give us some details about what you are looking for and we can help. if you want some good assistance in Danish, you could always ask our distributor:

    DENMARK

    Penil Design
    Maaloevvej 96
    DK-3660 Stenloese
    Phone: int +45 48195252
    Fax: int +45 48195251
    Web: http://www.penil-design.com
    Email: peer.nielsen@penil-design.com

    But we can help you here as well.

    Ken Gracey
Sign In or Register to comment.