1 / 18

Practical PBASIC Programming

Join Joe Johnson for a practical PBASIC programming workshop. Learn the fundamentals, debugging techniques, and explore example programs. Don't miss out on this informative session!

demarcus
Download Presentation

Practical PBASIC Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Practical PBASIC Programming Joe Johnson January 6, 2001

  2. Agenda • Joe Johnson -- who is this guy? • The Big Picture • Before the Coding Begins • The Zen of PBASIC • Debug & Dashboard • Example Programs • Miscellany • Wrap Up

  3. Joe Johnson • B.S. Mechanical Engineering • University of Illinois 1984 • M.S. Mechanical Engineering • Purdue University 1986 • Ph.D. Mechanical Engineering • Purdue University 1989 • Delphi (part of GM until 1999) • 1989 - Present

  4. Joe Johnson • Chief Delphi Team Leader • 6th Year • “The Ooga Man” • “He can walk on his hands”

  5. The Big Picture • Innovation First’s Notes: • Must use Parallax Code V1.096 (or higher when avail.) to program “SX” chip properly • Download Program in 2 places: User & Default • Addresses Potential Problem with STAMP2’s

  6. Operator Interface CPU Radio Radio Robot Controller CPU The Big Picture (cont.) • Simplified Block Diagram 3 Digit Display Potentiometers Joy Stick Ports 1-4 Switches Discrete LED’s Dashboard Port Laptop PC Potentiometers Analog Port PWM Pins Valves Gyros Servos Switches Digital Port Relay Pins Motors STAMP2 CPU Discrete LED’s

  7. The Big Picture (cont.) • What is your Role in the World? • CPU in a bubble • Only Indirect Contact with Outside world • Live by the rules others set and you may do great things • Break the rules and you are likely to be cut off

  8. The Big Picture (cont.) • Quick Tour Of Parallax Software (Stampw_v1_096.exe) • Basic Icon Tour • Opening a file • Downloading a file • EEPROM Map • RAM Map

  9. The Big Picture (cont.) • Block Diagram of Default Code Housekeeping Initialization Main Loop

  10. Before the Coding Begins • Get Latest Manual • Version 2.0 of the Stamp Manual is worth the price • Put thought into Operator Interface and Robot Switches/Pots • Define Inputs and Outputs as soon as possible • Number your motors, pots, switches, Victors, Spikes

  11. Before the Coding Begins (cont.) • Neat Wiring Saves time in the long run • Use number tape on everything! • Invest in many paint pens (various colors) • Design your switches & pots in from the start • Build yourself a “yellow dongle”

  12. The Zen of PBASIC • By the Numbers • Word 0 - 64K $0000 - $FFFF • Byte 0-255 $00 - $FF • Nibble 0-15 $0 - $F • Bit 0-1 $0 - $1

  13. The Zen of PBASIC • By the Numbers $FFFF $0000 $8000 $7FFF

  14. The Zen of PBASIC • Min 0 -- What good is it? • () will drive you nuts -- I recommend that you learn what precedence and use it to your advantage • Force yourself to use structure -- comment your code, use Gosub calls, settle on a “style” and keep to it.

  15. Debug & Dashboard • Dashboard is “free” • does not affect program execution • it is FREE from Innovation First • limited ability to display interesting stuff • you can role your one viewer, but … • Debug love it, hate it. • slows execution of PBASIC • can display nearly limitless information, just when you need it most

  16. Example Programs • Cool Tricks to steal from the Default Code • Do THIS for THAT much time • Scaling Pots • Learning Pot Limits • Joystick Wheel as a Throttle • Proportional Feedback

  17. Miscellany • ParallaxInc.com & Read the Manual • Support form other teams • HOT team (Mike Gray in particular) • The BUZZ Team • SharingFIRST web site • ChiefDelphi.com Tech Forums • Call me 248.696.5672

  18. Wrap Up • PBASIC gives you enough rope to hang yourself • Have backup copies of program handy • Make sure the backups are current (use dates in names) • Have fall back positions • Keep your sanity • Go easy on your programmers -- pressure is very high

More Related