Shop OBEX P1 Docs P2 Docs Learn Events
Penguin Code versus Toddler Code - port comparison, etc. — Parallax Forums

Penguin Code versus Toddler Code - port comparison, etc.

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2007-09-24 06:11 in Robotics
I haven't yet gotten a Penguin, but I have a perfectly good Toddler right next to me.

I am just wondering if anyone has moved Penguin programs over to the Toddler and noted any significant differences.· I suspect that I can do it without difficulty.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • HumanoidoHumanoido Posts: 5,770
    edited 2007-09-20 15:55
    Kramer, yes you can port Toddler code to
    Penguin by making a few adjustments, keeping
    the following in mind:

    1) The servos are on different ports
    2) The servos have different motion limits
    3) Calibration is different due to the new motion limits
    4) Timing is different with the faster 2px

    5) Sensors are on different ports
    6) Sensors have different timing
    7) FREQOUT will require frequency & timing adjust
    8) Peizo speaker is on a different port
    9) IR Transmitter frequency will change due to the differences in clock pulse


    Please add any additional items left out.
    For the photodetectors and IR receiver/transmitters, you can
    refer to some very nice code written by David Carrier to see
    the ports, timing, code, etc. He recently posted updates to
    the original code. Otherwise, refer to the Penguin manual for
    a ports listing.

    Penguin Documentation
    www.parallax.com/dl/docs/prod/robo/27313-6%20PenguinDoc-v1.0.pdf

    Penguin Code
    www.parallax.com/dl/docs/prod/robo/PenguinCode.zip

    Penguin Code Updated
    forums.parallax.com/forums

    humanoido
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-21 16:32
    Thanks,
    The references make is all very easy to get going. The adjusting of motion limits is no big deal.

    That list is enough to get started. I suppose I could have my Toddler driven by a BS2px in order to reduce converting all the timing factors. Then it would be mostly I/O redistribution.

    I have a BS2px sitting right here, so it seems the right thing to do. It has more software features, more RAM and programing space too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • HumanoidoHumanoido Posts: 5,770
    edited 2007-09-22 04:01
    Thanks Kramer, glad to help. The motion limits are
    posted in the forum and listed in the Penguin manual.
    You're right, these are just minor adjustments.
    Running the Toddler on the 2px sounds like a good
    idea while you're waiting for Penguin to arrive! I'm
    sure Toddler robot will get a supercharged platform
    out of it! Your 2px - is it a single chip or on a board?

    Which Toddler programs will you work on converting
    to the 2px platform? It will be interesting to compare
    these converted programs with current Penguin
    programs! There's also some Toddler modified
    programs posted in the Toddler Group you may want
    to look at. This is a great project and very worthwhile.
    Please keep us informed of your progress.

    humanoido
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-23 10:38
    I was thinking of moving code in the other direction - converting the Penguin programs to the Toddler platform, but using a BS2px. The Penguin takes advantage of the additional memory and speed. The Toddler originally has a BS2 [noparse][[/noparse]great on power consumption at a mere 9ma, but there are rechargible CR123 batteries] and is more limited in many ways.

    I have pretty much worked through the Toddler code and since the Penguin is a later generation, I suspect that the NEW code and NEW goodies will make the Toddler provide me with more fun.

    The only disadvantage is that the Todder requires a floor rather than a table top to work with. I keep worrying about kicking it or stepping on it. And of course, you can easily put the Penguin in your knapsack and show it off to friends. The Toddler is a whole shoebox to move.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 9/23/2007 5:46:57 PM GMT
  • D FaustD Faust Posts: 608
    edited 2007-09-23 10:50
    Couldn't you use conditional compilation so the constants would change based on the directive you put in?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • HumanoidoHumanoido Posts: 5,770
    edited 2007-09-23 14:28
    D Faust, yes, very good idea! Bby creating multiple sets of
    constants a directive could call one robot code or the other,
    keeping in mind all changes required. And why not?
    The microcontroller should do all the work and be
    flexible. However, it's most likely this code would
    overflow the first page of EEPROM, thus requiring
    two sets of code to load via the Editor. And that is
    certainly doable. Are you thinking of working on this
    unique duality code?

    humanoido
  • D FaustD Faust Posts: 608
    edited 2007-09-23 15:41
    No, I don't have a toddler or penguin, just a boe-bot. I read about the idea somewhere else in thye forums.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-23 17:50
    I'm sorry but I just hate conditional compilation. Generally it adds pages of preamble before you get to the guts of a program.

    I am looking for the core concepts, not universal software.

    While it is great for Parallax to release such code with accessories because the user can immediately verify the new device works properly, it is a real distraction to learners. They get lost and never move ahead.

    So, I learn more from having to adapt specific code to another device than I could ever learn from trying to sort out which conditional compilations apply to what.

    I strongly suspect that Senix Ubicom drove away sales by trying to provide complete conditional compilations along with the more important virtual peripherals concept.· I have to substantially strip thier code examples down from 20 or more pages to 3 or 4 before I can learn anything.

    If you want to learn, keep it short.

    Guenther's text is wonderful because it keeps it all simple.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 9/23/2007 5:58:20 PM GMT
  • HumanoidoHumanoido Posts: 5,770
    edited 2007-09-24 06:11
    Very good points.
    There's a time and place for everything
    and I expect the place for code of duality
    nature is for "user" simplicity, and not
    necessarily for one who is learning code or
    sorting it out bit by bit for advanced
    modifications. It would probably take
    three times as long to complete duality
    code over that of a singular nature but
    that's just a guess.

    Besides, you'd have to rewire Toddler
    robot or Penguin robot to get that kind
    of compatibility. It does sound like a
    very interesting project to replace the
    original Toddler board with one from
    Penguin. It's lighter, smaller, faster,
    and the PBasic language dialect is more
    powerful. Plus, the compass,
    2 photodectors, segment display, IR
    transmitter, 2 IR receivers, power LED,
    reset button, and expansion port are
    already there for use. It's almost
    plug-n'-play for people who want to
    concentrate on immediate results.

    humanoido
Sign In or Register to comment.