PBP projects for R/C models


Results 1 to 40 of 772

Threaded View

  1. #11
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Red face The code is very simple

    The code is a very simple state machine. I shall post a flow diagram if I can figure out an appropriate CAD tool.

    Can (should?) middle school kids be asked to deal with the uncertainties of the real world? I think this TOY level car demonstrates that ambiguity in an appealing and dramatic fashion.

    The code consists of a set of hardware related constants which need not be changed.

    11 Variable definitions and the following four car behavior constants.

    frontdanger - 12 inches
    stopreversing - 26 inches
    frontfree - 72 inches
    desiredtrack - 36 inches

    A routine that triggers the SONARS and puts the code in a tight loop when the radio transmitter has been turned on.

    Six IF statements. These are each state machines. They evaluate the SENSOR data and tell the wheels what to do. Their labels are:

    CheckIfInDanger
    TryLeftTurn
    TooCloseToWall
    TooFarFromWall
    ReverseOutOfTrouble
    Keepreversing

    At one level all the students need to modify are the constants. At another level they can modify these six IF statements. An advanced student could add more states.

    Ken
    Last edited by Kenjones1935; - 17th December 2010 at 19:08.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts