BoeBotTeacher.com

    Resources for teaching with the Parallax Boe-Bot

Propeller C Quick Learner Kit http://www.parallax.com/product/910-32910

ActivityBot Robot Kit  http://www.parallax.com/product/32500 

2013.09.04

Kits should be here in a few days. From the picture, several thoughts:

  • The big hump for me will be re-thinking my intro notes. I've distilled the essential points of each chapter down to a few points & drawings that I do before they start the activities. I think those are pretty tight after all these years. How much will that have to change: 10% or 90%? Stay tuned.
  • My first reaction is that there are so many features on the ActivityBoard. How can they be covered in same number of class hours as BoeBot? It looks to me like this is material for two whole course, each the length of the BoeBot class. I can't see any of the basic concepts from BoeBot that could be dropped, other than the light detection. We will see...
  • Although this transition will take some time (I haven't even started on the concepts and language) I think it is the right direction. I think getting students on the path of multi-core instead of interrupts is the way of the future. I hung on to COBOL and FORTRAN too long after OOP emerged - I won't make that mistake again.

2013.09.05

  • I'm excited about the SD. It has always been a drag to write one program to record to EEPROM then write a second program to read from the EEPROM. I did get around that by checking if a button was pressed on start to then call either read or write subs, thus no second program. Pulling out a card and straight to import to Excel will be great. I'm curious about the lesson activity that Andy writes for the SD lesson; that could be another database & graph for this site. Calibration-ServoData.aspx

2013.09.06

  • Paper or web page notes or both?  In the past I haven't been able to totally switch from paper to my laptop / tablet notes. I frequently want to sketch a picture in my notes and I haven't been able to get the hang of that on a PDF with a mouse. I have a loose-leaf of the printed PDF of the texts. They are same size as the text so that leaves a wide margin on letter size paper. I use that margin to write notes for class. Here is what I hope Plax will do.
    • Have all the lessons on line
    • Have them in a form that allows me to export to Word so I can make additions electronically
    • Have a way on the web (dynamic) to see an outline or summary.   I'd like to know if I send students to "Simple Circuits" what will be the activities and in what order. Ideally, include names of code files. In other words, I'd like a sort of outline/map of the whole on-line text. If the export to Word is done right the use of Heading Styles will solve the whole thing in Outline View.

2013.09.08

  • Looks like better tires on the wheels - I'm curious if they go on easier.
  • I'm curious how necessary the encoders will be for a first go. How will it do with just repeating x number of servo pulses ala BoeBot. How far will the text pages to with handling curves. On the encoder sold separately there is a long section on the calculus of different radii.
  • The high speed servo is interesting. I wonder how they will hold up. My first thought is that it would be easy to re-gear for high speed. But now we are dealing with higher forces for start & stop. I wonder if ramping will be, essentially, required. I guess I'll set up a little test rig with some weights and drive one of the high-speed servos to failure.
  • I wonder how much current the high speed servos draw compared to old-school. It looks like it is designed for five cells. Will 1.2v cells be enough?

2013.09.09

Looks like the ActivityBoard comes with audio output jack.  For a moving Bot that means some kind of speaker & mount. The Veho looks like an option but I wonder about how heavy it can get i.e. balance.   Veho Bracket (URL=? I know I saw it somewhere). But when on the bench the students can use headphones/buds. I'm curious about the sound quality.

2013.09.10

I was confused on the difference between the Propeller Project Board USB and the Propeller Proto Board. They look the same except for the prop chip location. More comparisons here (feel free to edit).

  • The Proto board needs a PropPlug to program. It has a jack for the required external power.
  • The Project board has on-board programming by the USB. It and can be powered by the USB. Alternate power source connection must be bought and soldered to pads. 

2013.09.12

I teach mostly adult hobbyists, older teens and teachers in informal settings (non-graded). So we are not sticklers for Kirchhoff’s; I tell them to use a 470 ohm and they do. But in every class there are a few that ask why 470. The basic calcs are not hard to understand so I run through the equations and can give them a couple extra exercises.

But it would be a stronger lesson if they could try some different voltages and loads and measure them. V of 3.3, 5 are on board plus a 9v battery is always around. A multimeter would work but I saw Plax carried a voltage and current sensing board and ordered two.

I hooked it up to a Prop board to measure a DC toy motor (5v, estimated 100 mA) running on +5v from board. The results were not so hot: voltages way above 5 and current = zero. I worked on this for several days with one of the Plax techs and he figured it out. There is about 1 sec of calibration that goes on when the sensor starts. If the motor is starting at the same time the high current / voltage drop of the starting motor messes with the calibration which never recovers. I switched to LEDs and it worked perfectly, even showing the difference between red and green LEDs. The tech is changing the object, I think to re-calibrate if first calibration fails.

Two take-homes:

  • Use the new object dated after 2013.09.01 (maybe not ready as of 2013.09.12)
  •  With a significant load (motor), have the motor up to speed before turning on the sensor. You can do with powering motor circuit independent of board.

2013.09.17

Two common and easy tasks in the BASIC STAMP Editor (BSE) are not easy (yet) in the Prop SimpleIDE (SIDE).
The BSE Run/Identify is great. The SIDE identity is only known by looking at the ports list at the top right. If more than one board is connected you won't  know which.
Toward the end of the course, as per WAM, I have students examine the Memory Map to understand space allocation for vars, program code and data. There is not, as of now, a similar graphic in SIDE.  You can go to the Project Manager and right mouse click on the .c or .cpp file and select map, but hold on to your hat... the results is a very low level list. For my level of students it is not simple enough to understand.
Having said the above, it is still early in the game. I suspect these items are on the ToDo list.

2013.09.18

 Sometimes you use something for years and then all of a serendipitously find a new function. I noticed today that a BS2 file can have a directive to force which port to use:  Menu: Directive / Port

2013.09.22

 The on-line tutorial Propeller C Learning System is real good so far. One small suggestion: whenever possible groups of titles should be kept parallel. With Simple Circuits and Simple Devices I would like to see Simple Start.

2013.09.24

 More on the on-line tutorial Propeller C Learning System. The web layout of the home page implies a path through the tutorials:

o   Propeller C Tutorials

§  Set Up SimpleIDE

§  Start Simple

§  Simple Circuits

§  Simple Devices

§  Functions

§  ActivityBot

I read it as start with Set UP.. and go down the list. After set-up is the Start Simple which covers coding. As of 2013.09.24:

Then Simple Circuits includes interaction with hardware. As of 2013.09.24:

The problem is that my students are not going to sit through Start Simple of ten lessons on coding before touching the hardware. How can they resist that static-resistant bag of goodies while I drone on about coding Array Variables? My suggestion (and I will be working on this myself) is to identify which circuits can be made based on the knowledge of each coding section. I think my class meetings will consist of a Simple Start unit (coding) followed by a Simple Circuit unit.

 

2013.09.26

 Project conflict? Say in period one I have advanced students that have created their own project. They leave the SimpleIDE open. Period two are newbies that start with loading Hello Message.c.  Will they get the "not part of project error"?

 

2013.10.12  

Products that go together but don't have the same name lead to confusion. There is the Propeller C Learning System - fine name. Then there is the Propeller C Quick Learner Kit. Do these go together or are there a different sets of lessons for Quick Learn and "regular" learn? The answer is that these go together. I understand that product names may be set long before other parts of the picture are named. But I hate the idea of having any impediment to a newbie hitting the site and quickly understanding what to order to get started.

2013.10.14

A few edits to my standard answer to STAMP vs. Prop vs. Arduino vs. ...

2013.10.22

I thought the Propeller C Learning System (PCLS) was basically the WAM/BoeBot/SIC concept with two changes.

1.      Content changed to topics for Prop.

2.      Format changed from paper to web.

But it turns out to be different. Whereas WAM is a complete curriculum, PCLS topics treated at a level similar to the first few pages of a WAM chapter. There is a little theory then one example (activity).    

2013.11.01

I have an option to teach a uCon intro course in Feb with Prop instead of WAM. I'd really like to, but don't have time to write a curriculum. I like to be over-prepared so I want materials as deep as WAM: multiple activities, exercises, projects, questions. I'm sure at some point P'lax will make a SIC (PIC?) for Prop similar to WAM. Until then I guess course will be run with WAM.  

2013.11.03

Teaching an Intro to Microcontrollers with Prop – levels

The Prop C Quick Learner Kit (PCQLK) includes, basically, four items (or sets):

1.      Activity Board

2.      Veho Speaker

3.      Bag of WAM parts

4.      Extra devices: Ping, Accelerometer, etc.

I’m thinking I will divide the intro microcontroller with C/Prop into two levels. The first will cover the WAM parts, the second the additional devices.

 2013.12.01

A note on two syntax points with include of libraries. Neither throws an error but looks unprofessional  

 

#include library names are actually not case sensitive. Compiler will still find. But it looks better to use the case of the library which by convention is all lower case.

 

#include is not a command and so should not end in a semicolon. However if you do put one on there the compiler still handles it with a warning (not error) in the compile log.

 

2013.12.15

I’ve been trying to boil down the introductory sentences to  my students for terminal output. I think this works:

 

What is sent Terminal

Three kinds of elements can be sent to the terminal: text, cursor placement and variables.

There is a big difference in languages for the location on the command line of these elements

In PBASIC all three elements are lined up as arguments.

In C they are integrated using escape characters, placeholders and arguments

 

In PBASIC:

Text, cursor placement and variables all are arguments to DEBUG, lined up with comma separators.

Code sample in pink below

 

In C:

Text is presented together, all of it in one pair of double quotes

Cursor placement is set within the text by using the \ character.

Within the text there are % characters for placeholders for where to insert the variables.

Variable values are provided as arguments after the text.

Code sample in blue below

 

 

DEBUG “myVar = ”,DEC2 myIntVariable 

Print(“myVar = %d2”,myIntVariable);  ‘ at %d myIntVariable will be put in 

DEBUG “myVar = ”,DEC3 myIntVariable  ‘for value 70 DEC3 displays 070

Print(“myVar = %d3”,myIntVariable);  ‘ for value 70 %d3 displays 070

DEBUG  ‘no floats (decimal numbers) in PBASIC

Print(“myVar = %f”,myFloatVariable);  ‘ default display of 6 decimals

Print(“myVar = %f3”,myFloatVariable);  ‘ set to 3 decimals

DEBUG DEC2 myIntVariable ‘shows the variable only 

Print(“%d”,myVariable); ‘shows the var only

DEBUG “myVar = ”,STR myStringVariable ‘

Print(“myVar = %s”,myStringVariable); ‘ n.b. %s for string

 

 

2014.01.05

Note on SIDE

In many IDE there is a menu choice for view from which you can select what tool panels to display: project explorer, watch, log, etc. SIDE only has three panels.

The editor panel is always open

The compile log appears automatically during compile

The project panel is a little weird to turn on/off.  Its presence is set by the menu/Tools/Set view:

Simple View = no project explorer panel

Project View = with project explorer panel

 

2013.01.17

The multiple types of files and their organization are a source of confusion if coming from PBASIC. PBASIC has one file (xxx.BS2). End of story.

C has three kinds of files, specific extensions and names and disk folder rules

Core file names (for starting level of sophistication)

1.      Projects in xxx.side             within SIDE one project open at a time

2.      Programs in xxx.c               within SIDE shown as a tab

3.      Libraries in xxx.h

4.      (after compile SIDE will auto-create several other files and folders)

Organization of files :

1.      A Project (xxx.side)  holds Program files (xxx.c)

2.      Each project has a folder on disk.

3.      Every project must contain a “main” program file with same name as project

4.      Extra files created by compiler will be in same project folder 

5.      Libraries are held in any folder that is under My Docs/SimpleIDE

Code location:

1.      Program files (xxx.c) hold methods (like PBASIC subs)

2.      All code must be within a method

3.      Code execution starts with main() of the program file with same name as project. When there is a run it is actually running the project, starting from main() of the main program

4.      Typically the role of main() is to call other methods

 

2014.02.02

Declaring the hardware and software version

In PBASIC include two declarations at top: {$STAMP BS2} and {$PBASIC 2.5}

In Prop C they are set as options in the SIDE interface and the compiler handles putting the actual directives into the code. Both H’ware and S’ware are set at the bottom of the project explorer where there are three tabs. Use Project Options.

If the Project Explorer is not available then Tools / Project Manager View)

 

2014.02.09

The SIDE is simple, so I don’t begrudge that common troubleshooting tools are left out (debug, watch).

But I can gripe about the interface of the tools that are there, in particular the tool bar’s groups of icons for files and Projects. It is far too easy to click File/Save when your intention is Project/Save. And if the difference is not clear you will have serious problems (see post of  2013.01.17 ).

I also think it is confusing to have a menu entry for program that is only for running the program. Basic tasks for files/programs is done under menu File.

 

2014.02.15

Prop C - CHAR / STRING variables – be careful

One char:            char myOneCharacter = 'a'; // n.b. use single quote

A string is an array of characters:               char myString[] = "abc"; // n.b. use double quotes

Trap: If you declare / assign a single character with double quotes (instead of proper single quote) then you are actually making an array of one member.  If you refer to the variable you will be referring to its memory address rather than the actual value

char myMistake = "m"; // note error of using double quotes for a single char

print("\n\nmyOneCharacter as character = %c",myOneCharacter);

print("\nmyString as string = %s",myString);

print("\nmyMistake as chaaracter = %c",myMistake);

print("\nmyMistake as decimal = %d",myMistake);

 

 

2014.03.01

Convert PBASIC DEUBG formatting to Prop C

A lot of my students are coming from my Basic Stamp classes to my new Propeller / C classes. Here is a cheat-sheet they can use to convert terminal output.

Summary of PBASIC and Prop C Print Format codes (most common):

PBASIC

Description

C

?

Displays "symbol = x' + carriage return; where x is a number. Default format is decimal, but may be combined with conversion formatters (ex: BIN ? x to display "x = binary_number").

?not available?

ASC ?

Displays "symbol = 'x'" + carriage return; where x is an ASCII character.

?

%c

DEC{1..5}

Decimal, optionally fixed to 1 - 5 digits

%{1…?}d

SDEC{1..5}

Signed decimal, optionally fixed to 1 - 5 digits

 

HEX{1..4}

Hexadecimal, optionally fixed to 1 - 4 digits

%x{1…?}

SHEX{1..4}

Signed hexadecimal, optionally fixed to 1 - 4 digits

 

BIN{1..16}

Binary, optionally fixed to 1 - 16 digits

 

STR ByteArray

ASCII string from bytearray until byte = 0.

%s

(no float in PBASIC)

Float

n.b. to use floats must turn on Math Lib:

SIDE (show project manager) lower left / linker

%f

 

 

2014.03.12

Servo values: A quick table to keep in front of my students that are switching from PBASIC to PropC.Text.
In PropC servo positions are given a different index. WAM was +/- 90 from center of zero. Prop C is 0 to 180 with 0 = full CW.

 

Location

WAM

Prop C

Full CCW

9 o’clock

Full left

-90 degrees

180

Centered

12:00

0 degrees

90

Full CW

3:00

Full right

+90 degrees

0

 

 

2014.04.09

Another common mistake I am seeing in students coming from PBASIC

Since PBASIC editor converts commands to upper case, some students are in a mode of expecting or wanting commands to be UC. When they do that in C, of course, it fails. Here is one that occurred a few times:

freqout(4,500,3000);

 

2014.04.20

Going from SELECT to SWITCH

This is old hat for C coders, but for my students learning C with a PBASIC background, they are falling in a trap. In PBASIC the code to execute for a given case does not need an explicit terminator. In C it does: break;

PBASIC

myDiscountCode VAR Nib

myPrice VAR Byte

myDiscountCode = 1

 

SELECT myDiscountCode

    CASE 1         'member discount

      myPrice = 6

    CASE 2,3       'senior and student

      myPrice = 8

    CASE 4 TO 7    'local resident

      myPrice = 9

    CASE ELSE      'full price

      myPrice = 10

  ENDSELECT

DEBUG myPrice

Prop C

Each case must end with a break (One case’s code does not automatic stop when next case starts; it will run through.)

int myDiscountCode;

int myPrice;

myDiscountCode = 7; // hard code, set before run

 

switch(myDiscountCode) {

case 1: //member discount

myPrice = 6;

break;

case 2: //n.b. no break so flows to case 3

case 3: //n.b. covers student and senior

myPrice = 8;

break;

// no "TO" syntax. Use listing (n.b. no commas) or if()

case 4: case 5: case 6: case 7:

myPrice = 9;

break;

default: //full price

myPrice = 10;

break;

} //switch

print("myDiscountCode = %d.\nmyPrice = %d.",myDiscountCode,myPrice);

return 0;

}