100% found this document useful (1 vote)
5 views

Microcontroller Projects Using the Basic Stamp 2nd Edition Al Williams (Author) download

The document is a promotional overview for the book 'Microcontroller Projects Using the Basic Stamp, 2nd Edition' by Al Williams, which is available for download in various formats. It includes information about the book's content, structure, and the author's credentials, as well as links to additional related books. The book serves as a comprehensive guide for beginners and enthusiasts interested in microcontroller projects using the Basic Stamp.

Uploaded by

ikeerutam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views

Microcontroller Projects Using the Basic Stamp 2nd Edition Al Williams (Author) download

The document is a promotional overview for the book 'Microcontroller Projects Using the Basic Stamp, 2nd Edition' by Al Williams, which is available for download in various formats. It includes information about the book's content, structure, and the author's credentials, as well as links to additional related books. The book serves as a comprehensive guide for beginners and enthusiasts interested in microcontroller projects using the Basic Stamp.

Uploaded by

ikeerutam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Microcontroller Projects Using the Basic Stamp

2nd Edition Al Williams (Author) pdf download

https://ebookname.com/product/microcontroller-projects-using-the-
basic-stamp-2nd-edition-al-williams-author/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Microcontroller Based Projects 2nd Edition Efy


Enterprises Pvt Ltd

https://ebookname.com/product/microcontroller-based-projects-2nd-
edition-efy-enterprises-pvt-ltd/

tinyAVR Microcontroller Projects for the Evil Genius


1st Edition Dhananjay Gadre

https://ebookname.com/product/tinyavr-microcontroller-projects-
for-the-evil-genius-1st-edition-dhananjay-gadre/

The 8051 Microcontroller and Embedded Systems Using


Assembly and C 2nd Edition Muhammad Ali Mazidi

https://ebookname.com/product/the-8051-microcontroller-and-
embedded-systems-using-assembly-and-c-2nd-edition-muhammad-ali-
mazidi/

Barbed Forest 1st Edition F. Ndi

https://ebookname.com/product/barbed-forest-1st-edition-f-ndi/
Chest Radiology PreTest Self Assessment and Review 1st
Edition Juzar Ali

https://ebookname.com/product/chest-radiology-pretest-self-
assessment-and-review-1st-edition-juzar-ali/

Depression 2nd Ed Causes and Treatment 2nd Edition


Aaron T. Beck

https://ebookname.com/product/depression-2nd-ed-causes-and-
treatment-2nd-edition-aaron-t-beck/

Fixed Income Securities Tools for Today s Markets 2nd


Edition Bruce Tuckman

https://ebookname.com/product/fixed-income-securities-tools-for-
today-s-markets-2nd-edition-bruce-tuckman/

Anti Formalist Unrevolutionary Illiberal Milton


Political Prose 1644 1660 William Walker

https://ebookname.com/product/anti-formalist-unrevolutionary-
illiberal-milton-political-prose-1644-1660-william-walker/

The Sorcery of Solomon A Guide to the 44 Planetary


Pentacles of the Magician King 1st Edition Sara L.
Mastros

https://ebookname.com/product/the-sorcery-of-solomon-a-guide-to-
the-44-planetary-pentacles-of-the-magician-king-1st-edition-sara-
l-mastros/
Old Soldiers First Edition David Weber

https://ebookname.com/product/old-soldiers-first-edition-david-
weber/
Microcontroller Projects
Using the Basic Stamp
Second Edition

Al Williams

CRC Press
c f lC Taylor & Francis G ro up
Boca Raton London New York

CRC Press is an im print of the


Taylor & Francis Group, an info rm a business
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

First issued in hardback 2017

Copyright © 2 0 0 2 by A1 Williams

CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

This book contains infoimation obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity
o f all materials or the consequences o f their use. The authors and publishers have attempted to trace the copyright holders
o f all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has
not been obtained. I f any copyright material has not been acknowledged please write and let us know so we may rectify
in any future reprint

Except as permitted under U.S. Copyright Law, no part o f this book may be reprinted, reproduced, transmitted, or utilized
in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying,
microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com(http://www.copyright.com/)
or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,978-7S0-8400. CCC is a
not-for-profit organization that provides licenses and registration for a variety o f users. For organizations that have been granted
a photocopy license by the CCC, a separate system o f payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification
and explanation without intent to infringe.

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com

ISBN: 978-1-57820-101-3 (pbk)


ISBN: 978-1-138-43645-9 (hbk)

C M P B o o k s
Table of Contents
In tr o d u c tio n .........................................................................................xi
The Challenge....................................................................................................................xii
Is This Book for Y o u ? ..................................................................................................... xii
W hat’s New in the Second E d itio n ? ......................................................................... xiii
What You N e e d ..............................................................................................................xiii
How to P ro c e e d ..............................................................................................................xiv

C h a p te r 1 Jum p Right I n ............................................................. 1


Getting S ta rte d ....................................................................................................................2
H ard w are..............................................................................................................................3
Other Prototyping N e e d s ................................................................................................ 7
The No-Hardware A p p roach ......................................................................................... 9
The Software.........................................................................................................................9
Your First Stamp P ro g ra m ............................................................................................10
The Outside W o rld .......................................................................................................... 11
Digital Basics.......................................................................................................................12
Number System s............................................................................................................... 13
Other Bases......................................................................................................................... 14
Boolean A lgebra............................................................................................................... 15
Connecting Hardware..................................................................................................... 16
Digital Systems in an Analog World: A Few Faws.................................................. 19
Pull-up and Pull-down R esistors..................................................................................23
Putting it All Together: Your Next Program ............................................................25
Summary..............................................................................................................................26
Exercises..............................................................................................................................26
iv Table of Contents

C h a p te r 2 The N itty G ritty — A Stam p R e fe re n c e 29


General Program Formatting and Labels...................................................................33
The Stamp I Memory Map and I/O............................................................................ 35
Stamp I Expressions..........................................................................................................39
The Stamp II Memory Map and I/ O ..........................................................................40
Stamp II Expressions....................................................................................................... 44
Handling Large, Negative, and Floating Point Expressions................................ 46

C O M M A N D REFERENCE...........................................................54
Section I — Data C o m m a n d s ................................................. 55
DEBUG I, II, USX, HE, IIP ...................................................................................... 56
SYMBOL 1 ....................................................................................................................59
CON II, USX, HE, I I P ............................................................................................. 60
VAR II, USX, HE, I I P ............................................................................................. 61
LET I ...........................................................................................................................62
EEPROM 1 ....................................................................................................................63
BSAVE 1 ...................................................................................................................... 64
DATA II, USX, HE, I I P ........................................................................................... 65
READ I, II, USX, HE, IIP .........................................................................................67
WRITE I, II, USX, HE, IIP ...................................................................................... 68
PUT USX, HE, IIP.....................................................................................................70
GET USX, HE, IIP.....................................................................................................72
RANDOM I, II, USX, HE, IIP ....................................................................................73
Section II — Flow Control ...................................................... 75
END I, II, USX, HE, IIP ........................................................................................... 76
PAUSE I, II, USX, HE, IIP ...................................................................................... 77
NAP I, II, USX, HE, IIP ........................................................................................... 78
SLEEP I, II, USX, HE, IIP ...................................................................................... 79
GOTO I, II, USX, HE, IIP .........................................................................................80
IF I, II, USX, HE, IIP ..............................................................................................81
BRANCH I, II, USX, HE, IIP ....................................................................................84
GOSUB I, II, USX, HE, IIP ...................................................................................... 86
RETURN I, II, USX, HE, IIP ....................................................................................90
FOR I, II, USX, HE, IIP ........................................................................................... 91
NEXT I, II, USX, HE, IIP .........................................................................................93
RUN USX, HE, IIP.....................................................................................................94
Section III — Digital I / O ...........................................................95
INPUT I, II, USX, HE, IIP ...................................................................................... 96
Table of Contents V

OUTPUT I, II, USX, HE, IIP................................................................................. 97


HIGH I, II, USX, HE, IIP...................................................................................... 98
LOW I, II, USX, HE, IIP........................................................................................ 99
TOGGLE I, II, USX, HE, IIP................................................................................ 100
REVERSE I, II, USX, HE, IIP.............................................................................. 101
PULSOUT I, II, USX, HE, IIP.............................................................................. 102
PULSIN I, II, USX, HE, IIP.............................................................................. 103
COUNT II, USX, HE, I I P ................................................................................... 105
BUTTON I, II, USX, HE, IIP.............................................................................. 106
X0UT II, USX, HE, I I P ....................................................................................... 108
Section IV — Analog I/O ...................................................... 110
PWM I, II, USX, HE, IIP........................................................................................ Ill
POT 1 ....................................................................................................................... 113
RCTIME II, USX, HE, I I P ................................................................................... 114
SOUND 1.................................................................................................................. 116
FREQ0UT II, USX, HE, I I P .............................................................................. 117
DTMF0UT II, USX, HE, I I P .............................................................................. 119
Section V — Serial I / O ........................................................... 120
SERIN I, II, USX, HE, IIP................................................................................. 121
SER0UT I, II, USX, HE, IIP................................................................................ 128
SH IFTIN II, USX, HE, IIP................................................................................... 130
SHI FT0UT II, USX, HE, I I P ............................................................................ 131
Section VI — T a b le s ................................................................132
LOOKUP I, II, USX, HE, IIP................................................................................ 133
L00KD0WN I, II, USX, HE, IIP........................................................................... 134
Section VII — Specialized I/O ............................................ 135
AUXI0, MAINI0 IIP............................................................................................... 136
I2CIN, I2C0UT B S IIP ....................................................................................... 137
I0TERM B S IIP ...................................................................................................... 138
LCDCMD, LCDIN, LCD0UT B S I IP ...................................................................... 139
0WIN, OWOUT B S IIP ............................................................................................ 141
Section VIII — Event H a n d lin g ............................................ 142
POLLIN B S IIP ...................................................................................................... 143
POLLMODE B S IIP ................................................................................................. 144
POLLOUT B S IIP .................................................................................................... 145
POLLRUN B S IIP .................................................................................................... 146
POLLWAIT BSIIP.................................................................................................... 147
vi Table of Contents

Section IX — M ath Operators .............................................149


+, * , / I, II, USX, HE, I I P .............................................................................150
* * I, II, USX, HE, IIP ........................................................................................... 151
*/ II, USX, HE, I I P ..............................................................................................152
// I, II, USX, HE, IIP ........................................................................................... 153
» , « II, USX, HE, I I P ...................................................................................... 154
MIN, MAX I, II, USX, HE, I I P .............................................................................155
ABS II, USX, IIE, I I P ........................................................................................... 156
SQR II, USX, IIE, I I P ........................................................................................... 157
SIN, COS II, USX, IIE, I I P ................................................................................. 158
DIG II, USX, IIE, I I P ........................................................................................... 159
Section X — Logical Operators .......................................... 160
&, I, A I, II, USX, HE, IIP .................................................................................... 161
&/, |/, V 1 ............................................................................................................ 162
REV II, USX, IIE, I I P ........................................................................................... 163
DCD II, USX, IIE, I I P ........................................................................................... 164
NCD II, USX, IIE, I I P ........................................................................................... 165
E xercises........................................................................................................................... 166

C h a p te r 3 Games and Tools: Digital I / O ............................169


I/O by Command............................................................................................................ 170
I/O with R egisters.......................................................................................................... 172
An LED C ounter............................................................................................................ 173
Driving Larger Loads..................................................................................................... 175
Driving Relays and Other Inductive L o a d s ........................................................... 178
Switching a R e la y ....................................................................................................... 178
Switching Power with PNP T ransistors...................................................................179
A PNP D riv e r .............................................................................................................. 180
Other S w itch e s...............................................................................................................180
A Word About AC L o a d s ........................................................................................... 181
Simulating Open Collector Outputs.......................................................................... 181
Working with Pulses.................................................................................................. 182
Counting Pulses...............................................................................................................183
Reading B u tto n s ............................................................................................................ 185
Experimenting with B u tto n .........................................................................................186
Sharing I/O Pins...............................................................................................................187
Expanding I/O................................................................................................................. 192
Polling................................................................................................................................ 194
LED D i e ........................................................................................................................... 198
Table of Contents vii

Reaction G a m e ............................................................................................................... 200


Quiz Buttons....................................................................................................................204
Logic Probe...................................................................................................................... 205
Automated Cable T e s te r..............................................................................................208
Under the H o o d ............................................................................................................ 209
Summary........................................................................................................................... 210
Exercises........................................................................................................................... 210

C h a p te r 4 A Digital Power Supply: Analog O utput . . 2 1 1


Sound and Tone G eneration.......................................................................................212
Simple Speaker Circuits................................................................................................ 212
Experimenting with PWM Noise............................................................................... 213
Amplifiers.........................................................................................................................214
Connecting to the Phone L in e .................................................................................... 214
An E x a m p le ....................................................................................................................215
Generating Voltages Using P W M .............................................................................216
Trying P W M ....................................................................................................................219
Other Uses for PW M ..................................................................................................... 220
Traditional D/A............................................................................................................... 220
A Digital Power Supply................................................................................................ 222
Summary........................................................................................................................... 225
Exercises........................................................................................................................... 226

C h a p te r 5 A Recording V o ltm eter: Analog Input . . . . 227


Careful What You Ask F o r ......................................................................................... 228
Reading Resistance or Capacitance.......................................................................... 228
A Capacitance Meter Project.......................................................................................229
Using an A D C ................................................................................................................. 232
Averaging Readings........................................................................................................234
A Homebrew A D C ........................................................................................................237
The Recording V o ltm eter........................................................................................... 241
Voltage to Pulse Conversion...................................................................................... 242
The Simplest Analog In p u t......................................................................................... 243
Summary........................................................................................................................... 2 47
Exercises........................................................................................................................... 2 47

C h a p te r 6 Stam p to Internet: Serial I / O ........................... 249


D efin itio n s...................................................................................................................... 250
Simple Serial P ro to co ls................................................................................................ 251
Interfacing with the P A K -I......................................................................................... 251
v iii Table of Contents

The I2C Bus......................................................................................................................261


I2C B a sic s ........................................................................................................................ 262
Ending a T ransm ission ................................................................................................263
Slow S lav es......................................................................................................................263
Arbitrating Multiple M asters...................................................................................... 264
I2C Plans...........................................................................................................................264
Interfacing to an I2C EEPR O M ................................................................................. 265
A BS2P D atalog ger....................................................................................................... 275
Asynchronous C om m unications...............................................................................280
R S232 Basics................................................................................................................... 280
Open Collector A sync.................................................................................................. 283
A PC Frequency Counter............................................................................................. 284
More Power Supply....................................................................................................... 294
Extending PC I/ O ..........................................................................................................295
Stamps on the N e t..........................................................................................................306
Summary...........................................................................................................................311
E xercises...........................................................................................................................311

Chapter 7 A Pong Game: LCDs and K e y p a d s ..................313


Serial L C D s...................................................................................................................... 314
LCD Interfacing...............................................................................................................314
The BSIIP...........................................................................................................................316
LCD Com m ands............................................................................................................ 316
LCD Softw are................................................................................................................. 317
Scanning a K e y p a d ....................................................................................................... 322
Analog Keypads...............................................................................................................324
Making the M ost of Limited K eys............................................................................ 325
Graphical LCDs...............................................................................................................325
D etails................................................................................................................................326
Summary...........................................................................................................................338
Exercises...........................................................................................................................338

Chapter 8 A Remote Control Robot: M o t o r s ..................339


DC M o to r s ...................................................................................................................... 340
Using P W M ...................................................................................................................... 343
The H Bridge....................................................................................................................344
About Stepper M otors.................................................................................................. 345
S erv o s................................................................................................................................348
Cannibalizing M o to rs .................................................................................................. 359
Table of Contents ix

Summary........................................................................................................................... 362
Exercises........................................................................................................................... 362

C h a p te r 9 Morse Code Projects............................................ 363


Morse Code I D e r .......................................................................................................... 364
Morse Code K e y e r ........................................................................................................366
An Keyboard Keyer........................................................................................................377
Reading C o d e ................................................................................................................. 387

C h a p t e r 10 The Next S te p ......................................................391


Why Not Stam ps?.......................................................................................................... 392
What You Will Need..................................................................................................... 392
Softw are........................................................................................................................... 393
Other Softw are............................................................................................................... 394
Assembler Survival G u id e........................................................................................... 396
Hardware S h o rtcu ts..................................................................................................... 397
Getting S ta rte d ...............................................................................................................402
The Real T h in g ...............................................................................................................406
Beyond P IC s ....................................................................................................................406
Stamps + P IC s?...............................................................................................................407
A Sample PBP Program ................................................................................................ 408
Summary........................................................................................................................... 409
Exercises........................................................................................................................... 409

C h a p t e r 11 On Your O w n ......................................................411
The Parallax Mailing L is t ........................................................................................... 411
W e b S ite s .........................................................................................................................412

A p p e n d ix A A bout the C D -R O M ..........................................415


About the Stamp I Simulator...................................................................................... 415

A p p e n d ix B The APP-I PIC P ro g ra m m e r........................... 419


W hat’s N eed ed ?............................................................................................................ 419
Building I t .........................................................................................................................420
Softw are........................................................................................................................... 420
Troubleshooting............................................................................................................ 421
PICAWC84 C o n tro ls ...................................................................................................421
Using the COM Port as a Power Supply................................................................ 422
X Table of Contents

A p p e n d ix C M aking Cables ................................................. 423


Stamp I ............................................................................................................................. 423
Stamp II, USX, IIE, and I I P .........................................................................................424

Answ er K e y ........................................................................................ 425


Chapter 1 A nsw ers....................................................................................................... 425
Chapter 2 A nsw ers....................................................................................................... 426
Chapter 3 A nsw ers....................................................................................................... 426
Chapter 4 A nsw ers....................................................................................................... 431
Chapter 5 A nsw ers....................................................................................................... 433
Chapter 6 A nsw ers....................................................................................................... 435
Chapter 7 A nsw ers....................................................................................................... 441
Chapter 8 A nsw ers....................................................................................................... 446
Chapter 9 (No exercises) ............................................................................................. 448
Chapter 10 A nsw ers.....................................................................................................448
Chapter 11 (No ex ercises) ...........................................................................................449

In d e x .................................................................................................... 451

Description of Dow nloadable Files............................................ 464

Files described throughout the text o f this b ook as available on C D -R O M


can now be dow nloaded from
ftp://ftp.cm pbooks.com /pub/M icroctrBasicStamp.zip
Introduction
Do you know who Rube Goldberg was? He was the cartoonist made famous by his
drawings of outlandish inventions. You know the type: Sunrise causes light to fall on
sleeping cat (a) causing it to wake and yawn, pulling string, (b) which tips perch, (c)
startling canary, (d)... You remember. The end result would be something mundane,
like flipping pancakes or applying shaving cream.
Although Mr. Goldberg’s inventions were supposed to be funny, most of us engi­
neers, scientists, and inventors actually had a sneaking desire to build things that did
simple mundane tasks (but without the cat and the canary, of course). For many
years, these mundane things went without automation, but Mr. Goldberg’s name
became synonymous with something that was a hodgepodge of parts using maxi­
mum effort to achieve a minimal result. There are even Rube Goldberg competitions
where students compete by constructing egg crackers, chin wipers, and other exotic
machinery.
Not that real Rube Goldberg machines didn’t exist. I remember when my parents
bought an early phone answering machine for their business. This was before the
days when you could legally connect things to the phone line. The machine took a
small endless-loop tape and also connected to an ordinary cassette recorder. It also
had a large cradle that went between the phone and the phone’s handset (remember,
in those days there were only a few styles of phones).
The machine’s cradle would detect shaking and signal the main unit that the
phone must be ringing. The main unit would start a motor turning that drove a set of
cams. The first cam signaled a solenoid in the cradle that allowed the phone’s hook
to rise, thereby answering the phone. The next cam allowed the endless-loop tape to
play the outgoing message (for exactly 15 seconds). The third cam then turned on the

xi
x ii Introduction

cassette recorder for exactly 30 seconds to record the incoming message. Finally, the
first cam released the solenoid so the phone would hang up. This also shut down the
motor so that the entire system was ready to go again.
That system was quite expensive and it was prone to answering the phone when
you slammed the door, or otherwise shook the device. Today, machines like this are
compact, reliable, and cheap. Why? Microprocessors.
The microprocessor is truly the universal machine. It does nothing unless you tell
it what to do, but that’s the good part: it will do whatever you tell it. Once an expen­
sive component, volume and technological advances have made microprocessors
inexpensive enough to be in practically everything.

The Challenge
What does this mean? If you want to design, build, or troubleshoot modern elec­
tronic equipment, you must understand microprocessors. Not too long ago, micro­
processor development was an expensive undertaking requiring special equipment
(certainly more than most hobbyists were willing to spend and even more than some
small companies were willing to commit). Today, however, there is an alternative
that allows you to start working with microcontrollers with just a PC. No special
programming hardware, no expensive cross-compilers, no ultraviolet erasers
required! Just an ordinary PC, a simple to construct cable, a Basic Stamp (often
called a Stamp; from Parallax Incorporated), and a nine volt battery will get you
started.
Basic Stamps are simple to use, but they are very powerful. Better still, the princi­
ples you’ll learn to master Basic Stamps will apply to all kinds of microprocessors,
regardless of the type.

Is This Book for You?


You’ll enjoy this book if you want to build things. Maybe you want to build a robot.
Or you might have an idea about automating a manufacturing process. Maybe you
just want to build an electronic game, or animate your Christmas lights. That’s what
this book is all about: solving problems with microprocessors in general and with the
Basic Stamp in particular.
If you’ve never worked with Stamps before, you’ll find everything you need to get
started here. Chapters 1 and 2 will introduce you to the Stamp and the basic elec­
tronics you’ll need to get started. If you have worked with Stamps before, you’ll find
practical advice for PC interfacing, using serial EEPROMs and other devices, analog
I/O, and a host of projects that will help you realize your own designs.
W hat's N ew in the Second Edition? xiii

W hat's N ew in the Second Edition?


Writing a book about something as dynamic as Basic Stamps is like trying to hit a
moving target. Between Parallax’s rapid product development and the vibrant user
community of Stamp developers, there is always something new to talk about.
Luckily, many of the foundations I talked about in the first edition of this book
still apply — even to the newest Stamps. However, there are several new Stamps
(including the powerful BS2P) and many more peripheral options that expand the
power of the Stamp. For example, the BS2P can drive LCD displays and work with
I2C devices directly.
In this second edition, I’ve covered these new advances in Stamp technology. In
addition, I’ve added several new projects including an RS232-controlled power sup­
ply, a bridge that lets a Stamp connected to a PC communicate via the Internet, and
several new robotics projects, as well.

W hat You Need


Before starting this book, you should have some understanding of basic electronics.
That is, you should be able to read schematics, know the difference between voltage
and current, and be able to apply Ohm’s law. If you are rusty on some of these
things, you can still wade through by reading the first chapter. Some of the projects
later in the book will assume you know quite a bit more that this, but you’ll be able
to get a lot from this material with just that basic background.
You also need a PC, ideally one that can run Windows 95, or Windows 98. Win­
dows N T will work for most things too. That is all the hardware you’ll need to get
started. The CD -ROM contains enough software that you can do some Stamp exper­
iments “virtual reality-style.” Of course, to really get your hands dirty, you’ll need a
bit more than just a PC.
The first thing you’ll need if you want to really build something is a Stamp. These
are available from a variety of sources (see Appendix A). Even Radio Shack can
order them for you. At the time of writing, you could pick up a Stamp D or Stamp I
for about $35. However, if you can spare around $50, you’ll be better satisfied with
the Stamp II. There are a few other types of Stamps you can buy, but one of these
will certainly get you started. If you want the top of line Stamp (at the time of this
writing, anyway) get a BS2P. The 40-pin version has plenty of inputs and outputs
although the 28-pin variant will work in any circuit that expects a Stamp II.
You also need a way to build circuits using the Stamp. The Stamp D comes with a
small area where you can wire wrap or solder circuits directly to the Stamp. The oth­
ers require some sort of wiring assembly. This can be as simple as a piece of perf
board from your local Radio Shack where you can solder or wire wrap your circuitry.
xiv Introduction

However, you can also buy small PC boards specifically for the Stamp from Parallax.
My company, AWC, makes several solderless breadboard adapters that work with
the Stamp also. You can also use a plain, solderless breadboard but you’ll have to
wire it up yourself, which can get messy. Solderless breadboards make it very easy to
experiment and try different circuits with a minimum of expense. There are other
prototyping options available that you will read about in Chapter 1.
The last piece of the puzzle is a cable. Exactly what you need here depends on
what kind of Stamp you will use and how you are building your circuits. For exam­
ple, the Stamp D or the Stamp I require a special cable you can build or buy from
Parallax. The Stamp II boards from Parallax and the AWC ASP-II require regular
cables that you can find nearly anywhere.
If you plan to build your own cables, be aware that the Stamp I and Stamp D plug
into the PC’s printer port. The other Stamps plug into the serial port. You’ll find
more details about the various Stamps, their boards, and cables in Chapter 1.
The only other essential requirement is some way to power the Stamp. This can
be a 9V battery (which works very well), an AC adapter, or a lab power supply. You
could even draw the power from a PC power supply, if you don’t mind breaking into
your PC. The Stamp is not picky. You can feed it regulated 5V, or supply it with a
higher voltage and let its onboard regulator provide 5V.
You don’t need anything else to get started. You don’t need any manuals or soft­
ware — that’s on the CD -ROM (and you can get updates on the Internet at
www.paral 1 axinc.com). You don’t need special programming hardware — that’s on
the Stamp itself. You don’t need a special eraser — the Stamp knows how to erase
itself!

How to Proceed
If you are experienced in the ways of electronics and computers, you might want to
read just the beginning of Chapter 1 and then move on to the later chapters. If you’ve
used the Stamp before, you can probably skip right to the chapters that interest you
the most.
Everyone will probably browse Chapter 2. It contains all the Stamp’s program­
ming commands along with explanations about them and the differences between
the versions of the Stamp. Browsing through this chapter will give you lots of ideas
about what you can make a Stamp do.
The simplicity of the Stamp makes it ideal in a teaching environment. I’ve person­
ally taught some Stamp programming to sixth graders who were in a robotics com­
petition! Because many high school and college courses make use of the Stamp, most
of the chapters include exercises and their solutions. Comparing your solutions to
the answers at the end of the book can be very enlightening. In microcontroller
How to Proceed XV

design, there are always many ways to accomplish any task. If your way works, it is
probably just as good as the book’s solution. Perhaps it is even better. You can evalu­
ate the relative merit of different solutions in a variety of ways, so rating one answer
over another is fraught with peril when both give the same results.
As the old adage goes, “the longest journey begins with the first step.” If this is
your first step into microprocessors, you’ll find it to be one of the most fascinating
and enjoyable journey’s you’ve made. If you are already walking that road, I want to
show you some of the interesting spots I’ve found on my trip. Either way, get ready
to get addicted. Microcontroller projects are like potato chips: I’ll bet you can’t do
just one!
XVi Introduction
Chapter 1

Jump Right In
For many years, I’ve been an avid Star Trek fan (as are many engineers, I suppose).
But no matter how much I enjoy the show, I still can’t help but find fault with it on
occasion (perhaps that’s the part I enjoy). Take Mr. Spock. Spock has one thing in
common with many scientist-types on TV. He knows about everything. Remember
the professor on Gilligan’s Island? Same thing. He isn’t a biologist, or a chemist, or a
metallurgist. Nope. He is all of those things and more.
In real life, we aren’t so lucky. We have to specialize in something. I have a lot of
friends who are chemical engineers, for example. I know a few astronomers. I only
know a cursory amount about what they do, and for the most part, they don’t know
much about computers.
The catch is that computers are the universal machines and no matter what your
field of endeavor, you probably have some ideas about how a computer could help
you do it better. Maybe you want to control a chemical process, or move a telescope
by remote control. Spock or the professor would have no trouble. But in real life,
many people have to turn to specialized engineers to make these ideas a reality.
Of course, computers are ubiquitous, and many people from many different disci­
plines now understand the ideas behind writing a program and routinely write soft­
ware that helps them do their job. Sometimes these programs will help many people
in the same field do their job. But there seems to be a difference between writing

1
2 Chapter 1: Jum p Right In

some PC software in, say, Visual Basic, and designing a dedicated computer to move
a telescope, right?
In the past, that has been true. Dedicated microcontrollers were the province of
experts that understood digital hardware and programming. With the advent of
Basic Stamps, however, all this is changing. The Basic Stamp is a special microcon­
troller that requires very little (if any) supporting hardware. As the name implies,
you program it using a special dialect of Basic — a language that many people know
and is considered easy to learn.
The Basic Stamp is opening up microcontroller design to a whole range of people
who want to build solutions . Even electronic specialists who know how to use the
more arcane microcontrollers find that Basic Stamps are easy, productive, and fun to
use. In a few minutes you can develop something that would take days or even weeks
using conventional techniques. Little jobs that would be too much trouble to solve
with a common microcontroller are simple with Basic Stamps.
In fact, the Basic Stamp is so much fun that is has a fan club — sort of. There is a
very active mailing list, maintained by Parallax (the company that makes the Stamp),
where over 1,000 Stamp users ask questions and offer advice. The users of this list
generate an unthinkable amount of mail each day with problems that range from the
simple to the complex. (See Chapter 11 for more about this mailing list and other
resources).
Another reason the Stamp is so popular is that it doesn’t require much investment
to get started. If you are a resourceful scrounger, you’ll only need the Stamp itself
(and a PC, of course). Even if you want to buy everything ready-made, you’ll only
wind up spending a few dollars more, depending on what choices you make.

Getting Started
So your first step is to select a Stamp and buy it. Using software on the CD-ROM ,
you can actually get your first taste of the Stamp without buying anything (sort of a
virtual reality Stamp). Of course, that Stamp only runs on your PC. To control the
real world, you will have to get a real Stamp.
You can order Stamps directly from Parallax, buy them from Radio Shack (they
order them for you), or get them from most major electronic catalogs (see Chapter
11). The question is: what kind of Stamp should you get?
There are several when it comes to Stamps. Each one is a bit different, and you’ll
have to decide for yourself which best suits your needs. You’ll find a summary of
your choices in Table 1.1. You can also find the specifications for each in the
datasheets on the CD-ROM . For the purposes of most of this book, the Stamp I and
the Stamp D are the same, so I’ll usually refer to the Stamp I, and you can assume the
Stamp D is the same. The only difference is in the packaging.
Hardw are 3

By the same token, many of the Stamp variants have different packaging (for
example, the OEM Stamp II or the BSIIP/40). From a software point of view, these
parts are the same, so I will treat them as equivalent.

Table 1.1 Types of Stamps.

Program Data Speed


Name size memory (instructions Notes
(bytes) (bytes) /sec)
Stamp D 256 14 2,000 Same as Stamp I, except for
package
Stamp I 256 14 2,000
Stamp II 2,048 26 4,000
Stamp USX 16,384 26/63 10,000 Holds eight programs of
2,048 bytes each
Stamp HE 16,384 26/63 4,000 Low-power version of
Stamp USX
Stamp IIP 16,384 26/63 12,000 28- and 40-pin version;
each holds eight programs
of 2,048 bytes

Don’t be alarmed at the Stamps’ apparently small sizes of memory. You’ll find
that it is often more than enough for the types of jobs you’ll tackle with the Stamp. If
you are used to dealing with PCs with dozens of megabytes and high-speed Pentium
processors, you’ll have a bit of culture shock. But for embedded microcontrollers,
the Stamps have plenty of memory and speed.

Hardware
Once you have your Stamp, you’ll need some way to program it. Here’s the good
news. The only thing you really need is a 9V battery and a cable. What kind of cable
you need depends on the Stamp you select. The Stamp I and Stamp D connect to
your PC’s printer port, and therefore require a DB25 cable. For the Stamp D, the
other end of the cable connects to some pins (like jumper pins) on the Stamp’s PC
board. You can buy the cable ready-made from Parallax, or build your own using the
instructions in Appendix C. Because printer cables are cheap, you can easily buy one,
cut the end off, and wire the correct end. The other Stamps require a connection to
your serial port.
4 Chapter 1: Jum p Right In

All of the Stamps except for the Stamp D and the OEM Stamps resemble inte­
grated circuits (ICs). The Stamp I has a single row of pins (a Single Inline Pin or SIP
package). The other Stamps utilize a DIP (Dual Inline Pin package). In either case,
you’ll find you need something to hold the Stamp while you work.
The simple approach is to get a piece of perfboard (often known as Vector Board
or Vero Board) with holes on 0.1-inch centers. You can then use solder or wire wrap­
ping techniques to make connections between your cable and the Stamp (as well as
other circuit components).
While this approach is simple, it isn’t ideal. Of course, you’d want to solder to a
socket, not the Stamp directly, but the soldering makes it tedious to make changes
and experiment.
If you prefer, you can buy a small PC (printed circuit) board (known as a carrier)
from Parallax. These boards have a socket for the Stamp and a connector for the
cable. The Stamp I carrier uses the same cable as the Stamp D. The carrier for the
other Stamps use a standard 9-pin serial cable connector. These carriers offer a small
area where you can solder or wire wrap your creations. They also provide for a 9V
battery to connect to the Stamp. However, they also require major surgery if you
want to build something different or even change your existing design. Also, the area
for your circuits is small. You can find a picture of the carrier boards in Figure 1.1
and 1.2.

Figure 1.1 This carrier board holds the Stamp I for prototyping.

The best way, in my opinion, to work with Stamps is with a solderless bread­
board. The breadboards themselves are available from a variety of vendors and are
quite common. The breadboard provides holes that have spring contacts beneath
them. You insert components (including the Stamp) into the holes and the springs
grab the wire leads and grip them. The holes connect in certain patterns, so inserting
wires in particular holes make connections between parts of your circuit.
H ardw are 5

The only problem with breadboards is that it is not very handy to connect cables
to them. You can always make up something that will connect the cable to the bread­
board, or you can get adapters especially designed for this purpose from AWC (see
Chapter 11). If you want to roll your own, you might consider soldering wires to a
socket, plugging the socket into the breadboard, and then plugging the Stamp into
the socket.

Figure 1.2 The Stamp II carrier board.

Another advantage to breadboards is that they naturally decouple high-frequency


noise. If you don’t use a breadboard, you’ll want to include small capacitors (0.01 pF,
for example) with short leads between the power and ground connections of your
chips. The Stamp has a filter capacitor (22pF) built in, but when dealing with
high-frequencies you may still need a small decoupling capacitor even on the Stamp.
With a breadboard, the entire breadboard acts like a capacitor. The downside to this
is that it makes it tough to prototype high frequency designs on a breadboard. How­
ever, with the Stamp, you won’t be able to deal with frequencies that high anyway.
Another offering from Parallax is the Stamp Experiment Board. This board is like
a super-carrier board that not only holds a Stamp, but also has a variety of switches,
LEDs, and sockets for other parts onboard. This is the next best thing to a solderless
breadboard as long as the circuits you want to build are already on the experiment
board.
Parallax also offers the “Board of Education” which is a carrier board and a very
small solderless breadboard. Unfortunately, the breadboard is very small, and it isn’t
connected to the Stamp at all. It is just mechanically attached to the board.
6 Chapter 1: Jum p Right In

Regardless of your choice in prototyping boards, it all boils down to about the
same thing. You need a way to connect a battery, a cable, and whatever parts you
need to the Stamp. The battery, by the way, isn’t critical. The Stamp can run off a 5V
regulated voltage supply or you can feed in an unregulated voltage (like a battery)
and the Stamp will regulate it. Except for the Stamp USX, the regulator is beefy
enough that you can power simple circuits that need 5V from the Stamp’s regulator,
if you like. The Stamp USX, however, uses almost all the juice its regulator can pro­
vide. Because the Stamp has a built-in regulator, you can use nearly any power
source — an AC adapter, a battery, or a lab supply. Just make sure the output is DC
and doesn’t exceed the maximum voltage the Stamp can take.
Figure 1.3 shows the breadboard I use most often. It is a large breadboard from
Elenco that I picked up at a hamfest (a swap meet for ham radio operators) for $5. I
permanently built a 5V regulator circuit and wired a socket for a Stamp II. The cable
plugs in with an AWC ASP-2 adapter. You can build some very large projects on a
board this big.

Figure 1.3 The AWC ASP-II cable adapter attaches to a standard


breadboard.
O ther Prototyping Needs 7

Other Prototyping Needs


Of course, to make your Stamp do anything interesting, you’ll need some external
parts. To start with, you’d like a few LEDs, some momentary contact switches, and
an assortment of resistors and capacitors. The Stamp can produce sounds, so you’ll
probably want a piezoelectric speaker or a 32Q (32 ohm) dynamic speaker. Exactly
what you want depends on what you want to build.
If you are using a solderless breadboard, Radio Shack sells some switches that
will plug directly into the board. Look for part number 275-1571. While you are
there, you might want to look at buying some 5V (5 volt) LEDs. These are LEDs that
operate with 5V (the same voltage the Stamp uses). Most LEDs operate on lower
voltages and require a resistor to prevent the LED from burning out at 5V. These
LEDs simply have the resistor built-in. They are a bit more expensive than ordinary
LEDs, but they are very handy.
Just as a starting point, here is the list of parts that AWC supplies with the ASP-A
lab kit. You can find nearly all of these parts at Radio Shack (the part numbers are in
parenthesis). The only parts that are odd are the 32Q speaker and the 10K resistors.
If you can’t find a 32Q speaker, use a piezoelectric speaker (or liberate one from a
cheap radio). Don’t use a common 8Q speaker unless you solder a 22Q resistor in
series with one of the leads (which will make the speaker have a very low volume). In
the ASP-A, the 10K resistors are in a single package that plugs directly into the
breadboard. However, you can just as well use a handful of individual 10K resistors
if you can’t find them packaged.
• Four 5V LEDs (RS 276-208)
• Four switches that directly plug directly into the breadboard (RS 275-1571)
• Nine 10K resistors (RS 261-1335; see text)
• 10 22K resistors for various functions (RS 271-1339)
• One 32W Speaker (use a piezo speaker instead; RS 273-091)
• One O.lmF capacitor (RS 272-1069)
• Two lOmF capacitors (RS 272-1025)
• One 10K pot that mounts on a breadboard (RS 271-282)
• One LM 339 quad comparator (RS 276-1612)
Many of the projects in this book will use these parts. Of course, you can
scrounge around if you have a well-stockedjunk box. None of the values areespe­
cially critical. You can use ordinary LEDs if you include a dropping resistor (a topic
covered later in this chapter).
If you are planning on using the Stamp USX, you’ll also want a source of 5V reg­
ulated power for the rest of your circuitry. This is easy to do with a 7805 or 78L05
8 Chapter 1: Jum p Right In

voltage regulator (see Figure 1.4). You can also use a regulated bench supply. You
may want to use this even with the other Stamps. Although most Stamps can supply
5V to your circuit, if you draw too much current you might blow the regulator and
damage the Stamp. Since a 7805 costs about $1.50 at Radio Shack, and the least
expensive Stamp is about $39, it is well worth a 7805 for a little protection. Besides,
a 78L05 can supply up to 140 mA and the 7805 over 1 amp (with a heat sink).

wA No more batteries
You can run a Stamp for quite some time on a single 9V battery. However, it
tip seems the battery will die just as you are about to finish a project. One simple
solution is to buy a 9V battery eliminator (available nearly everywhere). This is
a usually a small wall transformer that has a 9V battery connector on the end of
the wire. This allows you the most flexibility since you can use a 9V battery
when you want to be free of the wall outlet, or plug in when you don’t want to
use batteries.

Because the Stamp has its own regulator (or if you use the regulator in Figure
1.4), you’ll have no problem with your 5V supply. However, don’t assume that the
battery eliminator’s output will really be 9V. Usually, it will be higher and drop as
you draw more current from it. Make sure and measure the output if you have any
doubts and you are connecting a component to the supposed 9V power.
Some cheaper eliminators might have some hum (residual noise from the AC
power line) that could affect your circuits. If you think this might be a problem, just
put an electrolytic capacitor across the input (in addition to the .33uF unit in Figure
1.4). This won’t affect your battery operation, but will filter out any hum.

Figure 1.4 A regulated 5V supply.

78L05
7-20VDC In _5V Out (,1A Max)
In Out
_L Gnd I
.33|iF .01|iF
^ rj

Another handy thing to have is a volt ohm meter (VOM). Digital VOM s (also
called DVMs) are quite inexpensive now and you really need one for any electronic
work. If you have access to an oscilloscope or other expensive test gear, good for
Another Random Document on
Scribd Without Any Related Topics
Riddell, Mr. Marsh, Marquis Gandolfi-
Hornyold, Hon. K. Dundas, Mr. Percival,
Mr. Churchill, Mr. D. J. Wilson.
The young Englishman, be he officer or settler in the East African
Highlands, cuts a hardy figure. His clothes are few and far between:
a sun hat, a brown flannel shirt with sleeves cut above the elbow
and open to the chest, a pair of thin khaki knickerbockers cut short
five inches—at least—above the knee, boots, and a pair of putties
comprise the whole attire. Nothing else is worn. The skin, exposed
to sun, thorns, and insects, becomes almost as dark as that of the
natives, and so hardened that it is nothing to ride all day with bare
knees on the saddle; a truly Spartan discipline from which at least
the visitor may be excused.
This is the way in which they hunt lions. First find the lion, lured to
a kill, driven from a reed-bed, or kicked up incontinently by the way.
Once viewed he must never be lost sight of for a moment. Mounted
on ponies of more or less approved fidelity, three or four daring
Britons or Somalis gallop after him, as in India they ride the pig—
that is to say, neck or nothing—across rocks, holes, tussocks,
nullahs, through high grass, thorn scrub, undergrowth, turning him,
shepherding him, heading him this way and that until he is brought
to bay. For his part the lion is no seeker of quarrels; he is often
described in accents of contempt. His object throughout is to save
his skin. If, being unarmed, you meet six or seven lions
unexpectedly, all you need do—according to my information—is to
speak to them sternly and they will slink away, while you throw a
few stones at them to hurry them up. All the highest authorities
recommend this.
But when pursued from place to place, chased hither and thither
by the wheeling horsemen, the naturally mild disposition of the lion
becomes embittered. First he begins to growl and roar at his
enemies, in order to terrify them, and make them leave him in
peace. Then he darts little short charges at them. Finally, when
every attempt at peaceful persuasion has failed, he pulls up abruptly
and offers battle. Once he has done this, he will run no more. He
means to fight, and to fight to the death. He means to charge home;
and when a lion, maddened with the agony of a bullet-wound,
distressed by long and hard pursuit, or, most of all, a lioness in
defence of her cubs, is definitely committed to the charge, death is
the only possible conclusion. Broken limbs, broken jaws, a body
raked from end to end, lungs pierced through and through, entrails
torn and protruding—none of these count. It must be death—instant
and utter—for the lion, or down goes the man, mauled by septic
claws and fetid teeth, crushed and crunched, and poisoned
afterwards to make doubly sure. Such are the habits of this cowardly
and wicked animal.
It is at the stage when the lion has been determinedly "bayed"
that the sportsman from London is usually introduced upon the
scene. He has, we may imagine, followed the riders as fast as the
inequalities of the ground, his own want of training, and the burden
of a heavy rifle will allow him. He arrives at the spot where the lion
is cornered in much the same manner as the matador enters the
arena, the others standing aside deferentially, ready to aid him or
divert the lion. If his bullet kills, he is, no doubt, justly proud. If it
only wounds, the lion charges the nearest horseman. For forty yards
the charge of a lion is swifter than the gallop of a racehorse. The
riders, therefore, usually avoid waiting within that distance. But
sometimes they do not; or sometimes the lion sees the man who
has shot him; or sometimes all sorts of things happen which make
good stories—afterwards.
After this general description no particular example is required,
and the reader need not be disappointed to learn that our lion
escaped what, no doubt, would have been his certain destruction by
the breaking of a single link in the regular chain of circumstances.
He was not found upon the kill. His place was taken by a filthy
hyena, and it was not until we had beaten thoroughly for two hours
more than three miles of reed-bed that we saw him—a splendid
great yellow cat, looking as big as a bullock—bounding away up the
opposite hill. Off started our riders like falcons; but alas!—if "alas!" is
the proper word—a deep and impassable nullah intervened,
necessitating large circuits and long delays; so that the lion got clean
away out of sight of all men, and we were reduced to the slow and
tedious process of tracking him footprint by footprint through waving
grass, breast-high, hour after hour, always expecting to tread on his
tail, and always—disappointed!

The Banda at Thika Camp.


Colonel Wilson's Lion.

In the afternoon I had to ride to Fort Hall, where there was to be


a great gathering of Kikuyu chiefs and thousands of their warriors
and women. The country is much the same as that traversed on the
previous day, but greener, smoother, and more pleasant-looking. Fort
Hall is not a fort in any military sense, but the Commissioner's house
with a ditch round it, a jail, a few houses, and an Indian bazaar. The
station is hardly well selected, being perched up on a hill out of the
reach of any railway—and unhealthy nevertheless. The whole place
was crowded with natives in their most highly ornamented and
elaborate nudity, waiting for the war-dance.
This ceremony was performed the next morning. Long before
daylight the beating of drums, the blowing of horns, and the rhythm
of loud, yet not altogether unmelodious chanting awakened the
weariest sleeper; and when, at eight o'clock the indaba began, the
whole space in front of the fort was densely packed with naked,
painted, plumed, and gyrating humanity, which seethed continually
to and fro, and divided from time to time as particular chiefs
advanced with their followers, or as gifts of struggling sheep and
bulls were brought forward. In his war dress the Kikuyu, and, still
more, the Masai warrior, is a striking, if not impressive, figure. His
hair and body are smeared with the red earth of his native land,
compounded into a pigment by mixture with the slimy juice of the
castor-oil plant, which abounds. Fantastic headdresses, some of
ostrich feathers, others of metal or leather; armlets and leglets of
twisted wire; stripes of white clay rubbed across the red pigment;
here and there an old pot-hat or some European garment,
incongruously contrasted with leopard-skins and bulls' horns; broad,
painted cow-hide shields, and spears with soft iron blades nearly
four feet long, complete a grotesque and indecorous picture. Still,
there is a sleek grace about these active forms—bronze statues but
for their frippery—which defeats all their own efforts to make
themselves hideous. The chiefs, however, succeed in reducing
themselves to regular guys. Any old, cast-off khaki jacket or tattered
pair of trousers; any fragment of weather-stained uniform, a
battered sun-helmet with a feather stuck lamely into the top of it, a
ragged umbrella, is sufficient to induce them to abandon the ostrich
plume and the leopard-skin kaross. Among their warriors in ancient
gear they look ridiculous and insignificant—more like the commonest
kind of native sweeper than the hereditary rulers of some powerful
and numerous tribe.
"Durbar" at Kiambu.

It is unquestionably an advantage that the East African negro


should develop a taste for civilized attire. In no more useful and
innocent direction could his wants be multiplied and his desires
excited, and it is by this process of assimilation that his life will
gradually be made more complicated, more varied, less crudely
animal, and himself raised to a higher level of economic utility. But it
would surely be worth while to organize and guide this new motive
force within graceful and appropriate limits. A Government runs risks
when it intrudes upon the domain of fashion; but when a veritable
abyss of knowledge and science separates the rulers from the ruled,
when authority is dealing with a native race still plunged in its
primary squalour, without religion, without clothes, without morals,
but willing to emerge and capable of emerging, such risks may fairly
be accepted; and the Government might well prescribe or present
suitable robes for ceremonial occasions to the chiefs, and gradually
encourage, and more gradually still enforce, their adoption
throughout the population.
After the dance it had been arranged that I should go as far as the
bank of the Tana River to see the view of Mount Kenya, and then
return to the Thika camp before night. But when the whole splendid
panorama of the trans-Tana country opened upon us, I could not
bring myself to stop short of the promised land; and, casting away
material cares of luncheon and baggage, I decided to ride through
to Embo, twenty-eight miles from Fort Hall, and our most advanced
post in this direction. We crossed the Tana by a ferry which travels
along a rope under the impulsion of the current. The ponies swam
the deep, strong, sixty-yard stream of turbulent red water. On the
farther bank the country is really magnificent in quality and aspect.
The centre of the picture is always Mount Kenya; but there never
was a mountain which made so little of its height. It rises by long
gentle slopes, more like a swelling of ground than a peak, from an
immense upland plain, and so gradual is the acclivity that, but for
the sudden outcrop of snow-clad rock which crowns the summit, no
one would believe it over eighteen thousand feet high. It is its
gradual rise that imparts so great a value to this noble mountain; for
about its enormous base and upon its slopes, traversed by hundreds
of streams of clear perennial water, there grows, or may grow, in
successive, concentric belts, every kind of crop and forest known in
the world, from the Equator to the Arctic Circle. The landscape is
superb. In beauty, in fertility, in verdure, in the coolness of the air, in
the abundance of running water, in its rich red soil, in the variety of
its vegetation, the scenery about Kenya far surpasses anything I
have ever seen in India or South Africa, and challenges comparison
with the fairest countries of Europe. Indeed, looking at it with an eye
fresh from Italy, I was most powerfully reminded of the upper
valleys of the Po.
We rode on all day through this delicious country, along a well-
kept native road, smooth enough for a bicycle, except where it
crossed stream after stream on primitive bridges. On every side the
soil was cultivated and covered with the crops of a large and
industrious population. It is only a year since regular control was
established beyond the Tana, not without some bloodshed, by a
small military expedition. Yet so peaceful are the tribes—now that
their intertribal fighting has been stopped—that white officers ride
freely about among their villages without even carrying a pistol. All
the natives met with on the road were armed with sword and spear,
and all offered us their customary salutations, while many came up
smiling and holding out long, moist, delicate-looking hands for me to
shake, till I had quite enough of it. Indeed, the only dangers of the
road appear to be from the buffaloes which infest the country, and
after nightfall place the traveller in real peril. We were very glad for
this reason, and also because we had eaten nothing but a banana
each since early morning, to see at last on the top of the next hill
the buildings of Embo just as the sun sank beneath the horizon.
Embo is a model station, only five months old—one small, three-
roomed house for the District Commissioner, one for the military
officer, an office, and a tiny jail, all in good dressed stone; two
Indian shops in corrugated iron; and seven or eight long rows of
beehive grass huts for a hundred and fifty soldiers and police. Two
young white officers—a civilian and a soldier—preside from this
centre of authority, far from the telegraph, over the peace and order
of an area as large as an English county, and regulate the conduct
and fortunes of some seventy-five thousand natives, who have never
previously known or acknowledged any law but violence or terror.
They were uncommonly surprised to see four horsemen come riding
up the zigzag path to their dwelling; but their astonishment was no
bar to their hospitality, and we were soon rewarded for our journey
and our fasting in most excellent fashion.
I had just time before the darkness flooded the land and blotted
out the mighty mountain and its wreaths of fire-tipped cloud to walk
round this station. The jail consisted of a single room, barred and
bolted. Inside not a prisoner was to be seen. I inquired where they
were, and was shown two little groups seated round fires in the
open. They were chained together by a light running chain, and
after a hard day's miscellaneous work about the station they chatted
peacefully as they cooked and ate their evening meal. The prison
was only their shelter for the night—primitive arrangements, no
doubt, but are they more barbarous than the hideous, long-drawn
precision of an English convict establishment?
The African protectorates now administered by the Colonial Office
afford rare scope for the abilities of earnest and intelligent youth. A
man of twenty-five may easily find himself ruling a large tract of
country and a numerous population. The Government is too newly
established to have developed the highly centralized and closely knit
—perhaps too closely knit—hierarchy and control of the Indian
system. It is far too poor to afford a complete Administration. The
District Commissioner must judge for himself, and be judged upon
his actions. Very often—for tropical diseases make many gaps in the
ranks, and men must often return to England to recruit their health
—the officer is not a District Commissioner at all, but a junior acting
in his stead or in some one's stead, sometimes for a year or more.
To him there come day by day the natives of the district with all their
troubles, disputes, and intrigues. Their growing appreciation of the
impartial justice of the tribunal leads them increasingly to carry all
sorts of cases to the District Commissioner's Court. When they are ill
they come and ask for medicine. When they are wounded in their
quarrels it is to the white man they go to have the injuries dressed.
Disease and accident have to be combated without professional skill.
Courts of justice and forms of legality must be maintained without
lawyers. Taxes have to be collected by personal influence. Peace has
to be kept with only a shadow of force.
All these great opportunities of high service, and many others, are
often and daily placed within the reach of men in their twenties—on
the whole with admirable results. It was most pleasant to hear with
what comprehension and sympathy the officers of the East Africa
Protectorate speak about their work; and how they regard
themselves as the guardians of native interests and native rights
against those who only care about exploiting the country and its
people. No one can travel even for a little while among the Kikuyu
tribes without acquiring a liking for these light-hearted, tractable, if
brutish children, or without feeling that they are capable of being
instructed and raised from their present degradation. There are
more than four million aboriginals in East Africa alone. Their care
imposes a grave, and I think an inalienable, responsibility upon the
British Government. It will be an ill day for these native races when
their fortunes are removed from the impartial and august
administration of the Crown and abandoned to the fierce self-
interest of a small white population. Such an event is no doubt very
remote. Yet the speculator, the planter, and the settler are knocking
at the door. There are many things which ought to be done—good,
wise, scientific, and justly profitable. If the Government cannot find
the money to develop the natural economic strength of the country,
to make its communications, to start its industries, can it with any
reason bar the field to private enterprise? Can it prevent the ingress
of a white population? Ought it to do so, and for how long? What is
to happen when there are thirty thousand white people in East
Africa, instead of the three thousand or so who make so much stir at
the present time? Perhaps the course of these chapters will lead us
back again to these questions. I am very doubtful whether it will
supply their answers.
We have a discussion in the evening on a much more manageable
subject. The District Commissioner at Embo has been ordered by the
High Court of the Protectorate to retry a criminal case which he had
settled some months before, on account of an informality in the
report of the proceedings, which had excited the attention of the
revising authority. It is pointed out that neither the accused nor his
fellow-natives understand, or can ever be made to understand, the
meaning of this repetition of a trial; that they are bewildered; that
their confidence in their personal ruler may be weakened; that
endless practical difficulties—for instance, the collection of witnesses
scattered about in distant villages, and the disquietude caused to
them by a second summons from the strange, mysterious power
called "Government"—arise out of an error which only a lawyer could
detect, and which only appears upon a piece of paper. "Some one,"
quaintly says a young civil officer, who has ridden over with us,
"forgot to say 'Bo!' in the right place." I ask the nature of the "Bo!"
It is certainly substantial. No mention was made in the report of the
trial that the accused was given the opportunity of cross-examining
the hostile witnesses. Therefore, although this was in fact done, the
trial is held to be no trial, and ordered anew.
Now, here is again a balancing of disadvantages; but without here
examining whether a simple release would not have been better
than a retrial, I find myself plainly on the side of the "Bo!" There is
scarcely anything more important in the government of men than
the exact—I will even say the pedantic—observance of the regular
forms by which the guilt or innocence of accused persons is
determined. Those forms are designed to protect the prisoner, not
merely from the consequences of honest forgetfulness in his judges,
but from systematic carelessness and possible oppression. Once they
are allowed to be loosely construed the whole system of civilized
jurisprudence begins to crumble, and in its place there is gradually
erected a rough-and-ready practice dependent entirely for its
efficiency and fairness upon the character and intelligence of the
individual responsible. Necessary as it is to trust to personal
authority in the control of native races of the lowest standard, it is
not less necessary to assign well-marked limits to that authority,
and, above all, to place the simple primary rights of accused persons
to what we at home are accustomed to call a "fair trial" outside its
scope. Nor does the administrator really suffer in native eyes from
the apparition into his domain of superior authority. The tribesmen
see that their ruler—to them all-powerful, the man of soldiers and
police, of punishment and reward—is himself obedient to some
remote external force, and they wonder what that mysterious force
can be and marvel dimly at its greatness. Authority is enhanced and
not impaired by the suggestion of immense reserves behind and
above the immediate ruler—strong though he be. But upon this, as
upon other matters, it is not necessary for every one to be of the
same opinion; and even lawyers are not always wise.
On our homeward ride in the early morning we passed a Swahili
village. These Mohammedans have penetrated deeply and
established themselves widely in the Eastern parts of Africa. Armed
with a superior religion and strengthened with Arab blood, they
maintain themselves without difficulty at a far higher level than the
pagan aboriginals among whom they live. Their language has
become a sort of lingua franca over all this part of the world. As
traders they are welcomed, as fighting men they are respected, and
as sorcerers they are feared by all the tribes. Their Khan had
supplied us with bananas on the previous day with many expressions
of apology that, as we were unexpected, he had no "European
food." To-day all this was repaired. The men of the village, to the
number of perhaps fifty, walked sedately out to meet us, their long
white smocks in striking contrast to the naked, painted barbarians
who surrounded them. The Khan led up a white Arab stallion, of
vicious temper and tripling gait, to replace my wearied pony; and
then produced tea and a familiar tin of mixed biscuits, which he had
over-night sent runners to procure, that his hospitality might incur
no reproach.
While we were eating and parleying with the Khan there arrived
on the scene a mounted Kikuyu chief, with chair, umbrella, khaki
helmet, and other insignia, and attended by about a hundred
warriors in full feather. In order to show their respect they began at
once their war-dance, and we left them a quarter of an hour later
still circling and hopping to and fro with quivering spears and
nodding plumes to their monotonous chorus, while the white-robed
Swahilis stood gravely by and bade us farewell in the dignified
manners of the East. I reflected upon the interval that separates
these two races from each other, and on the centuries of struggle
that the advance had cost, and I wondered whether that interval
was wider and deeper than that which divides the modern European
from them both; but without arriving at any sure conclusion.
Our journey to Embo had been so delightful that I was not
inclined to hanker after rejected alternatives. But when we drove in
to the Thika camp as the sun was setting, tired out by fifty miles of
road, the first spectacle which saluted my eyes was a lion's skin
spread out upon the ground and Colonel Wilson engaged in
sprinkling it with arsenical powder. Then we were told the tale,
which in brief was that they were driving a long reed-bed, when the
lion sprang out and ran obliquely across the line of beaters. Wilson
fired and the lion bounded back into the reeds, whence stones, fires,
shoutings, shots, and all other disturbances failed to move him.
Whereupon, after two hours, being impatient and venturesome, they
had marched in upon him shoulder to shoulder, to find him,
fortunately, quite dead.
My friends endeavoured to console me by the news that lions had
now been heard of in two other places, and that we should be sure
to find one in the morning; and next day, after we had driven three
miles of reeds, it seemed that their hopes were well founded, for a
large animal of some kind could be seen moving swiftly to and fro
under cover, and every one declared this must be the lion. At last
only one more patch of reeds remained to beat, and we took up our
positions, finger on trigger, about sixty yards from the farther edge
of it, while the beaters, raising an astonishing tumult with yells and
the beating of tin cans, plunged boldly in. Parturiunt montes—out
rushed two enormous wart-hogs. Let no one reproach the courage
of the pig. These great fierce boars, driven from their last shelter,
charged out in gallant style—tusks gleaming, tails perpendicular—
and met a fate prepared for a king. With these and another which
we galloped down and pistolled on the way home I had to be
content, and can now, so far as I am concerned, sadly write, in the
expressive words of Reuter, "No lions were 'bagged.'"
CHAPTER III

THE HIGHLANDS OF EAST AFRICA


"Colour" is already the dominant question at Nairobi. "We mean to
make East Africa a white man's country," cries, in strident tones, the
Colonists' Association on every occasion. Truly a respectable and
impressive policy; but one which seems, at first sight, rather difficult
to achieve in a land where there are, so far, fewer than two
thousand five hundred whites and more than four million black
aboriginals. Can East Africa ever become a white man's country? Can
even the Highlands, with their cool and buoyant breezes and
temperate, unchanging climate, become a white man's country?
Never, certainly, in the sense that Canada, or, indeed, the United
Kingdom, are white men's countries—that is to say, countries
inhabited wholly by white people and subsisting upon an economic
basis of white unskilled labour.
It is scarcely worth while even to imagine the Highlands of East
Africa denuded of their native inhabitants and occupied solely by
Europeans. Such an idea is utterly impossible. Whatever may be the
increase in the white population in the future, it is safe to say that it
will be far more than counter-balanced by the multiplication of the
natives, as they are guarded against famine and prevented from civil
war. But were such a solution possible, it would be almost the last
thing in the world desired by those who clamour for "a white man's
country." For observe it is not against the black aboriginal that the
prejudices and interests of the white settler or trader are arrayed.
The African, it is conceded, is welcome to stay in his own country.
No economic competition has yet arisen or is likely to arise between
him and the new-comers. Their spheres of activity lie wholly apart,
for the white man absolutely refuses to do black man's work; not for
that harsh toil does he exile himself from the land of his birth; while
the native could not, in his present state of development, displace
the white man in skilled employments and the superintendence and
the organization of industry—even if he would—and nothing is
farther from his ambitions.
It is the brown man who is the rival. The European has neither the
wish nor the power to constitute a white proletariat in countries like
East Africa. In his view the blacks should be the private soldiers of
the army, but the non-commissioned officers and the commanders
must be white. This should not be dismissed as a mere assertion of
racial arrogance. It is an obstinate fact. It is already a grave defect
for a community to found itself upon the manual labour of an inferior
race, and many are the complications and perils that spring
therefrom. But what of the second storey? If there is to be any kind
of white society dwelling together year after year within the
standards of life and comfort to which Europeans have universally
been accustomed to aspire, and largely to attain, this middle stage
in the economic system must provide that white society with the
means of earning—as professional men, as planters, merchants,
traders, farmers, bankers, overseers, contractors, builders,
engineers, accountants, clerks—a living for themselves and their
families. And here strikes in the Asiatic. In every single employment
of this class, his power of subsisting upon a few shillings a month,
his industry, his thrift, his sharp business aptitudes give him the
economic superiority, and if economic superiority is to be the final
rule—as it has never been and never will be in the history of the
world—there is not a single employment of this middle class, from
which he will not, to a very large extent, clear the white man, as
surely and as remorselessly as the brown rat extirpated the black
from British soil.
Then what remains? What sort of social organizations shall we be
building up with so much thought and labour in these new lands
under the British Crown? There is already no white working class.
There is to be no white middle class. Room is left only for the
capitalist pure and simple—if one may so describe him. A vast army
of African labourers, officered by educated Indians or Chinese, and
directed by a few individuals of diverse nationalities employing
cosmopolitan capital—that is the nightmare which haunts the white
population of South Africa, and at which what there is of a white
population in East Africa is already shrieking vigorously.
Yet hear the other side. How stands the claim of the British
Indian? His rights as a human being, his rights as a British subject,
are equally engaged. It was the Sikh soldier who bore an honourable
part in the conquest and pacification of these East African countries.
It is the Indian trader who, penetrating and maintaining himself in all
sorts of places to which no white man would go or in which no white
man could earn a living, has more than any one else developed the
early beginnings of trade and opened up the first slender means of
communication. It was by Indian labour that the one vital railway on
which everything else depends was constructed. It is the Indian
banker who supplies perhaps the larger part of the capital yet
available for business and enterprise, and to whom the white settlers
have not hesitated to recur for financial aid. The Indian was here
long before the first British official. He may point to as many
generations of useful industry on the coast and inland as the white
settlers—especially the most recently-arrived contingents from South
Africa (the loudest against him of all)—can count years of residence.
Is it possible for any Government with a scrap of respect for honest
dealing between man and man, to embark upon a policy of
deliberately squeezing out the native of India from regions in which
he has established himself under every security of public faith? Most
of all must we ask, is such a policy possible to the Government
which bears sway over three hundred millions of our Indian Empire?
We are in presence of one of those apparently hopeless
antagonisms of interests which baffle and dispirit all who are
concerned in their adjustment. And these questions are not confined
to East Africa or to South Africa. A whole series of new problems has
arisen, and will grow graver and larger as the immediate history of
the British Empire unfolds. They erect themselves upon a field
almost wholly unstudied, and familiar only by the prejudices which in
every direction obstruct movement and view. The entry of the Asiatic
as labourer, trader, and capitalist into competition in industry and
enterprise not only with, but in, the Western world is a new fact of
first importance. Cheap, swift, easy means of communication, the
establishment of peace and order over land and sea, the ever-
growing inter-dependence of all men and all countries upon one
another, have given wings to Asiatic commercial ambition and
rendered Asiatic manual labour fluid, as it has never before been
fluid since the beginning of things.
Unless these new elements in the economic life of mankind can be
scientifically and harmoniously controlled and assimilated, great and
novel dangers menace alike the Asiatic and the European he
supplants. On the one hand we see the possible exploitation under
various unhealthy conditions of immense masses of Asiatic labour, to
the moral injury of the employer and to the degradation and
suffering of the employed; on the other the overturn of the
standards of living laboriously achieved or long obstinately battled
for among Europeans. Superadded to these we must foresee the
confusion of blood, of manners, of morals, amounting, where
operative upon any extensive scale, almost to the disintegration of
the existing order of society. And behind—very close behind—lie the
appeals to force, by mobs or Empires, to decide in a brutal fashion
the brutal question which of two sets of irreconcilable interests shall
prevail. It is not easy to measure the degree of political instability
that will be introduced into international relations, when the subjects
of a powerful military and naval State are continually exposed to
penal legislation and open violence, and into private life when the
white artisan is invited to acquiesce in his own extinction, in virtue of
laws which he himself controls, by a competitor whom, he believes,
he could strike down with his hands.
Yet the Asiatic, and here I also include the African native, has
immense services to render and energies to contribute to the
happiness and material progress of the world. There are spacious
lands whose promise can never be realized, there are unnumbered
harvests which can never be garnered, without his active co-
operation. There are roads and railways and reservoirs which only he
can make. There are mines and forests which will slumber for ever
without his aid. The mighty continent of tropical Africa lies open to
the colonizing and organizing capacities of the East. All those new
products which modern industry insistently demands are offered in
measureless abundance to the West—if only we could solve the
Sphinx's riddle in its newest form.
And is it after all beyond our reach to provide, if not a perfect, at
any rate a practical answer? There ought to be no insuperable
difficulty, in the present state of political knowledge and social
organization, in assigning different spheres to the external activity of
different races. The Great Powers have partitioned Africa territorially;
is it beyond the wit of man to divide it economically? The co-
operation of many different kinds of men is needed for the
cultivation of such a noble estate. Is it impossible to regulate in full
and intricate detail the conditions under which that co-operation
shall take place? Here white men can live and thrive; there they
cannot. Here is a task for one, there the opportunity of another. The
world is big enough. [I write as the stream of the Nile bears me
between the immense spaces of beautiful, fertile, unpopulated
country that lie north of the Albert Lake.] There is plenty of room for
all. Why cannot we settle it fairly?
It must be noted that the question of Asiatic immigration presents
itself to the Imperial point of view in several quite distinct forms.
There are, first of all, colonies which stand on the basis of a white
proletariat, and whose inhabitants, rich and poor, employers and
employed, are all Europeans. The right of such colonies to forbid the
entry of large numbers of Asiatics, and to preserve themselves from
the racial chaos and economic disturbance inseparable from such
immigration, cannot be denied, although its exercise ought no doubt
to be governed by various prudential and other considerations. But
these colonies differ markedly from those where the mass of the
population is not white, but black. Again, there are colonies which
possess responsible government, and where the number of the
white middle-class inhabitants very largely exceeds the Asiatic
community. It is evident that these stand in a wholly different
position from that of places like the tropical Protectorates of East
and West Africa.
Indeed, it may be contended that the very fact that the native of
British India will undoubtedly, wisely or unwisely, rightly or wrongly,
be refused access in any large numbers to several South African and
all Australian Colonies by their respective Governments, makes it all
the more desirable that the Imperial Government should afford in
the tropical Protectorates outlet and scope to the enterprise and
colonizing capacity of Hindustan. And, as I have written, these
countries are big enough for all. There is no reason why those
Highland areas which promise the white man a home and a career,
and where alone he can live in comfort, should not, as a matter of
practical administration, be in the main reserved for him. Nor, on the
other hand, why the Asiatic, if only he does not teach the African
natives evil ways—a contingency which must not be forgotten—
should not be encouraged to trade and settle as he will in the
enormous regions of tropical fertility to which he is naturally
adapted. Somewhere in this direction—I do not wish to dogmatize—
the immediate course of sound policy would seem to lie, and, guided
by the lights of science and tolerance, we may easily find it.
But the course of these reflections has carried me a good deal
farther than the politics of Nairobi would seem to justify; and I
hasten to return to the question with which I started: "Can the
Highlands of East Africa be made 'a white man's country'?" Let us
examine this by a fresh process. As one rides or marches through
the valleys and across the wide plateaux of these uplands, braced by
their delicious air, listening to the music of their streams, and
feasting the eye upon their natural wealth and beauty, a sense of
bewilderment overcomes the mind. How is it they have never
become the home of some superior race, prosperous, healthy, and
free? Why is it that, now a railway has opened the door and so much
has been published about them, there has not been one furious river
of immigration from the cramped and insanitary jungle-slums of
Europe? Why, most of all, are those who have come—the pioneers,
the men of energy and adventure, of large ambitions and strong
hands—why are they in so many cases only just keeping their heads
above water? Why should complaint and discontent and positive
discouragement be so general among this limited class?
I have always experienced a feeling of devout thankfulness never
to have possessed a square yard of that perverse commodity called
"land." But I will confess that, travelling in the East African Highlands
for the first time in my life, I have learned what the sensation of
land-hunger is like. We may repress, but we cannot escape, the
desire to peg out one of these fair and wide estates, with all the
rewards they offer to industry and inventiveness in the open air. Yet
all around are men possessing thousands of fertile acres, with
mountains and rivers and shady trees, acquired for little or nothing,
all struggling, all fretful, nervous, high-strung, many disappointed,
some despairing, some smashed.
What are the true lineaments concealed behind the veil of
boundless promise in which this land is shrouded? Are they not
stamped with mockery? Is not the eye that regards you fierce as
well as bright? "When I first saw this country," said a colonist to me,
"I fell in love with it. I had seen all the best of Australia. I had
prospered in New Zealand. I knew South Africa. I thought at last I
had struck 'God's own country.' I wrote letters to all my friends
urging them to come. I wrote a series of articles in the newspapers
praising the splendours of its scenery and the excellence of its
climate. Before the last of the articles appeared my capital was
nearly expended, my fences had been trampled down by troops of
zebra, my imported stock had perished, my title-deeds were still
blocked in the Land Office, and I myself had nearly died of a
malignant fever. Since then I have left others to extol the glories of
East Africa."
These second thoughts err, no doubt, as much on the side of
extravagant depression as the first impression was over-sanguine.
But that there is a rude reverse to the East African medal is a fact
which cannot be disputed, and which ought not, in the interests
either of the immigrant or of the country to be concealed. It is still
quite unproved that a European can make even the Highlands of
East Africa his permanent home—that is to say, that he can live
there without sensible degeneration for fifteen or twenty years at a
stretch without ever returning to the temperate zones; still less that
he can breed and rear families through several generations. The
exhilaration of the air must not lead people to forget that an altitude
of from five to eight thousand feet above the sea-level is an unusual
condition, producing results, not yet ascertained, upon the nervous
system, the brain, and the heart. Its coolness can never remove the
fact that we are upon the Equator. Although the skies look so
familiar and kindly with their white fleecy clouds and passing
showers, the direct ray of the sun—almost vertical at all seasons of
the year—strikes down on man and beast alike, and woe to the
white man whom he finds uncovered! Although sheep and oxen
multiply so rapidly, although crossing them with imported stock
produces in each generation astonishing improvements in quality,
they are subject to many perils little understood and often fatal. And
if the landscape recalls to the pensive traveller the peaceful beauties
of gentler climes at home, let him remember that it nurses with
blithe fecundity poisonous reptiles, and pest-spreading insects, and
terrible beasts of prey.
There is no reason, however, for doubting that modern science
possesses, or will discover, the means of eradicating or mitigating
many of these evils. As the development of the country and the
scientific investigation of tropical agriculture and tropical disease
proceed, the difficulties which beset the early settler will gradually
be removed. He will learn how to clothe and house himself; what to
plant, what to breed, and what to avoid. The spread of East Coast
fever, now carried by the ticks from one animal to another, and
carried by the infected animals from one district to another, will be
arrested, and controlled by a proper system of wire-fencing and
quarantine. Remedies will be discovered against the various diseases
which attack sheep or horses. Zebra, rhinoceros, buffalo, and other
picturesque and fascinating nuisances will be driven from or
exterminated within the settled areas, and confined to the ample
reserves of uninhabited land. The slow but steady growth of a white
population will create a market for local agricultural produce. The
powerfully equipped Scientific Departments, the Veterinary and
Forestry Departments, and the Department of Agriculture newly
established on a considerable scale, will be able to guide and assist
the enterprise of the new-comer, and save him from repeating the
ill-starred experiments of the pioneer. Roads will improve, and
railways and mono-rail tramways will extend. Step by step life and
the means of living will become easier and more secure. Still it will
not be proved that the pure-bred European can rear his children
under the Equatorial sun and at an elevation of more than six
thousand feet; and till that is proved "the white man's country" will
remain a white man's dream.
I have written of Europeans and Asiatics. What of the African?
About four millions of these dark folk are comprised within the
districts of the East Africa Protectorate which are actually or partially
administered. Many more lie beyond those wide and advancing
boundaries. What is to be their part in shaping the future of their
country? It is, after all, their Africa. What are they going to do for it,
and what is it going to do for them? "The natives," says the planter,
"evince a great reluctance to work, especially to work regularly."
"They must be made to work," say others. "Made to work for
whom?" we innocently ask. "For us, of course," is the ready answer;
"what did you think we meant?" And here we run into another herd
of rhinoceros questions—awkward, thick-skinned, and horned, with a
short sight, an evil temper, and a tendency to rush blindly up wind
upon any alarm. Is the native idle? Does he not keep himself and
pay his taxes? Or does he loll at his ease while his three or four
wives till the soil, bear the burden, and earn his living? And if idle,
has he a right to remain idle—a naked and unconscious philosopher,
living "the simple life," without cares or wants,—a gentleman of
leisure in a panting world? Is that to be the last word? Is civilization
to say definitely that when the African native has kept himself, or
made his women keep him, she has no further claim upon him? The
white man shall do the rest. He shall preserve the peace, that the
tribes may prosper and multiply. His watchful and foreseeing eye,
strained and weary with the effort, shall still make provision against
famine; his science, though he himself goes down in the struggle,
shall grapple with pestilence and cure disease. Far from his home or
from his family he shall hew the trees and dig the wells, shall dam
the streams and build the roads, with anxious heart and "in the
sweat of his brow," according to the curse laid upon the child of
many wants, while the child of few wants watches him from the
shade and thinks him mad.
And to compare the life and lot of the African aboriginal—secure in
his abyss of contented degradation, rich in that he lacks everything
and wants nothing—with the long nightmare of worry and privation,
of dirt and gloom and squalour, lit only by gleams of torturing
knowledge and tantalizing hope, which constitutes the lives of so
many poor people in England and Scotland, is to feel the ground
tremble under foot. "It would never do to have a lot of 'mean whites'
in this country," I heard one day a gentleman say. "It would destroy
the respect of the native for the white man, if he saw what
miserable people we have got at home." So here, at any rate, the
boot is on the other leg, and Civilization is ashamed of her
arrangements in the presence of a savage, embarrassed lest he
should see what lies behind the gold and purple robe of State, and
begin to suspect that the all-powerful white man is a fraud. But this
is an irrelevancy!
I am clearly of opinion that no man has a right to be idle, whoever
he be or wherever he lives. He is bound to go forward and take an
honest share in the general work of the world. And I do not except
the African native. To a very much larger extent than is often
recognized by some who discuss these questions, the natives are
industrious, willing to learn, and capable of being led forward. Live
for a few weeks, as I have done, in close association with the
disciplined soldiers of the King's African Rifles, or with the smart
sailors of the Uganda Marine, and it seems wonderful to contrast
them with the population from which they have emerged. How
strong, how good-natured, how clever they are! How proud their
white officers are of them! What pains they take to please the
travellers whom they escort; how frankly they are delighted by a
word of praise or thanks! Just and honourable discipline, careful
education, sympathetic comprehension, are all that is needed to
bring a very large proportion of the native tribes of East Africa to a
far higher social level than that at which they now stand. And why
should men only be taught to be soldiers? Is war always to have the
best of everything? Cannot peaceful industry be made as attractive,
be as highly organized, as carefully studied as the combined use of
deadly weapons? "Why," as Ruskin asks, "cannot men take pride in
building villages instead of only carrying them?"
I wonder why my pen slips off into these labyrinths, when all I set
out to do was to give some general idea of politics at Nairobi? But in
truth the problems of East Africa are the problems of the world. We
see the social, racial, and economic stresses which rack modern
society already at work here, but in miniature; and if we choose to
study the model when the whole engine is at hand, it is because on
the smaller scale we can see more clearly, and because in East Africa
and Uganda the future is still uncompromised. The British
Government has it in its hands to shape the development and
destiny of these new countries and their varied peoples with an
authority and from an elevation far superior to that with which
Cabinets can cope with the giant tangles at home. And the fact stirs
the mind. But by this time the reader will have had as much of East
African politics as I had when, after three days of deputations and
disputations, the train steamed out of Nairobi to take us to the Great
Lake and beyond.
CHAPTER IV

THE GREAT LAKE


We are off again on the Uganda Railway. Interesting and beautiful
as is the country through which the line passes from Mombasa to
Nairobi, it is surpassed by the magnificent scenery of the journey to
the Lake. First in order and in rank is the Great Rift. This curious
fault in the earth's surface, which geologists trace across the four
thousand miles of land and sea which separate us from Palestine,
and onward still to the southern end of Lake Tanganyika, is traversed
by the Uganda Railway at one of its most remarkable stages. For
sixty miles the Highland plateau has been rising steadily by a
succession of wooded undulations to a level of over six thousand
feet. Now it falls abruptly, almost precipitously, more than two
thousand feet. This frowning wall of rock and forest, which extends
straight as a ruler farther than eye can see, is the Kikuyu
Escarpment. As the train claws its way downwards by slant and
zigzag along its face, a majestic panorama breaks upon the view. Far
below, bathed in sunshine, stretching away to misty purple horizons,
lie the broad expanses of the Rift Valley. Its level surface is broken
by strangely moulded volcanic hills and shattered craters. The
opposite mountain wall looms up in the far distance, brown and
blue. We gaze down upon the plain as from a balloon, mistaking
forests for patches of green grass, and mighty trees for thorn-scrub.
The Rift Valley from the Kikuyu Escarpment.

Another hour or so and Lake Naivasha comes into view. This sheet
of water is about ten miles square, and the rim of a submerged
crater makes an odd, crescent-shaped island in its midst. Its brackish
waters repel the inhabitants, but afford shelter to numberless wild-
fowl and many hippopotami. At Naivasha there is the Government
stock farm. One may see in their various flocks the native sheep, the
half-bred English, the three-quarter-bred, etc. The improvement is
amazing. The native sheep is a hairy animal, looking to the
unpractised eye more like a goat than a sheep. Crossed with Sussex
or Australian blood, his descendant is transformed into a woolled
beast of familiar aspect. At the next cross the progeny is almost
indistinguishable from the pure-bred English in appearance, but
better adapted to the African sun and climate. It is the same with
cattle. In the first generation the hump of the African ox vanishes. In
the second he emerges a respectable British Shorthorn. The object
of this farm is twofold: first, to find the type best adapted to local
conditions; secondly, to supply the settlers and the natives with a
steadily broadening fountain of good blood by which their flocks and
herds may be trebled and quadrupled in value. The enthusiasm and
zeal of those in charge of this work were refreshing. At present,
however, their operations are restricted by insufficient funds and by
the precautions which must be taken against East Coast fever. The
first of these impediments may be removed; the second is less
tractable.
East Coast fever came across the German border a year and a half
ago, and since then, in spite of such preventive measures as our
scanty means allow, it has been gradually and slowly spreading
through the Protectorate. A diseased cow may take thirty days to
die. In the meantime wherever it goes the swarming ticks are
infected. They hold their poison for a year. If, during that time, other
cattle pass over the ground the ticks fasten upon them and inoculate
them with the sickness. And each new victim wanders off to spread
the curse to new ticks, who cast it back to new cattle, and so on till
the end of the story. At each point fresh areas of ground become
distempered, and fresh cows begin to drop off one by one, leaving
their evil inheritance to the ravening insects.

Government Farm at Naivasha.


So here we see the two principles of Nature at work
simultaneously—the blood-stock rams and bulls spreading their
healthy, fruitful life in ever-widening circles through the land; the
infected cattle carrying their message of death in all directions.
Every point that either attains, becomes at once a new centre of
vitality or dissolution. Both processes march deliberately forward to
limitless multiplications. The native is helpless in the face of
advancing ruin. Left to itself the evil would assuredly devour the
good, till the cattle were exterminated and the sickness starved to
death for lack of prey. But at this moment the white biped with
faculties of ratiocination intervenes from the tin-roofed Department
of Agriculture; discovers, for instance, that ground may be purified
by putting upon it sheep, into whom the ticks discharge their poison
harmlessly and are thereafter purged; erects hundreds of miles of
wire fencing to cut the country up into compartments, as a warship
is divided by bulkheads; encloses infected areas; destroys suspected
animals; searches methodically and ever more hopefully for
prophylactics and remedies; with one hand arrests the curse, with
the other speeds the blessing, and in so doing is surely discharging
rather an important function from a good many points of view.
My friends and I took four days in travelling to the Victoria
Nyanza, although the distance can be covered in twenty-four hours;
for we turned aside every day for sport or business, while our train
waited obligingly in a siding. Of the latter, indeed, there was no lack,
for the Governor and the heads of several departments were in the
train, and we laboured faithfully together at many prickly things.
Then at the stations came farmers, surveyors, and others, with
words of welcome or complaint, and a deputation of Boer settlers
with many expressions of loyalty to the Crown, and the chiefs of the
Lumbwa and Nandi tribes, with a crowd of warriors, and their Laibon
with his four wives, all in a row, till I was as tired of making "brief
and appropriate" speeches as my companions must have been of
hearing them.
The Laibon's Wives.
Railhead at Kisumu.

But Elmenteita was all holiday. Lord Delamere met us at the


station with Cape carts, ponies, and hog-spears, and we drove off in
search of pig over an enormous plain thickly peopled with antelope
and gazelle. I cannot pretend to the experience of both countries
necessary to compare the merits of pig-sticking in India and in East
Africa in respect of the fighting qualities of the animal, nor the
ground over which he is pursued. But I should think the most
accomplished member of the Meerut Tent Club would admit that the
courage and ferocity of the African wart-hog, and the extreme
roughness of the country, heaped as it is with boulders and pitted
with deep ant-bear holes concealed by high grass, make pig-sticking
in East Africa a sport which would well deserve his serious and
appreciative attention. At present it is in its infancy, and very few
even of the officers of the King's African Rifles can boast the
proficiency of the Indian expert. But everything in East Africa is at its
first page; and besides, the wart-hog is, at present at any rate,
regarded as dangerous vermin who does incredible damage to
native plantations, and whose destruction—by any method, even the
most difficult—is useful as well as exciting.
Our first pig was a fine fellow, who galloped off with his tail
straight up in the air and his tusks gleaming mischievously, and
afforded a run of nearly three miles before he was killed. The risk of
the sport consists in this—that the pig cannot be overtaken and
effectively speared except by a horse absolutely at full gallop. The
ground is so trappy that one hardly cares to take one's eyes off it for
a moment. Yet during at least a hundred yards at a time the whole
attention of the rider must be riveted on the pig, within a few yards
of whom he is riding, and who may be expected to charge at any
second. A fall at such a climax is necessarily very dangerous, as the
wart-hog would certainly attack the unhorsed cavalier; yet no one
can avoid the chance. I do not know whether Anglo-India will
shudder, but I should certainly recommend the intending hunter in
East Africa to strap a revolver on his thigh in case of accidents. "You
do not want it often," as the American observed; "but when you do,
you want it badly."
We passed a jolly morning riding after these brutes and shooting a
few Gazella Granti and Gazella Thomsoni, or "Grants" and "Tommies"
as they are familiarly called, and in looking for eland in the intervals.
At the end of Lake Elmenteita, a beautiful sheet of water, unhappily
brackish, a feast had been prepared, to which a number of
gentlemen from Lord Delamere's estates and the surrounding farms
had been bidden. A long array of flocks and herds was marshalled
on both sides of the track in due order, native-bred, half-bred, three-
quarter-bred, pure. Through these insignia of patriarchal wealth,
which would have excited the keenest interest in any traveller less
hungry and more instructed in such matters than I, we made our
way to an excellent luncheon, which, be sure, was not
unaccompanied by the usual discussion on East African politics.
It was late in the afternoon when we started back to the train,
which lay eight miles off in a siding. On the way we fell in with a
most fierce and monstrous pig, who led us a nice dance through
bush and grass and boulder. As he emerged into a patch of
comparatively smooth, open ground I made up my mind to spear
him, urged my pony to her top speed, and was just considering how
best to do the deed when, without the slightest provocation, or, at
any rate, before he had been even pricked, the pig turned sharp
round and sprang at me, as if he were a leopard. Luckily, my spear
got in the way, and with a solid jar, which made my arm stiff for a
week, drove deep into his head and neck before it broke, so that he
was glad to sheer off with eighteen inches of it sticking in him, and
after a dash at my companion he took refuge in a deep hole, from
which no inducements or insults could draw him.
Later we rode and killed another pig and chased a fourth
unsuccessfully, and it was nearly dark before the railway was
reached. As I was getting into my carriage they calmly told me that
six lions had walked across the line a quarter of a mile away and a
quarter of an hour before. A settler who had been to lunch at
Elmenteita was loading a hastily-borrowed revolver before starting
on his homeward ride to Nakuru, and as I gave him some cartridges,
I reflected that, whatever may be the shortcomings of East Africa,
the absence of an interesting and varied fauna is certainly not
among them.
Next day our train is climbing through dense and beautiful forests
to the summit of the Mau Escarpment. Admiration of the wealth and
splendour of the leafy kingdom is mingled with something very like
awe at its aggressive fertility. The great trees overhang the line. The
creepers trail down the cuttings, robing the red soil with cloaks of
flowers and foliage. The embankments are already covered. Every
clearing is densely overgrown with sinuous plants. But for the
ceaseless care with which the whole line is scraped and weeded it
would soon become impassable. As it is, the long fingers of the
encroaching forest are everywhere stretching out enviously towards
the bright metals. Neglect the Uganda Railway for a year, and it
would take an expedition to discover where it had run.
At Nyoro station nearly nine hundred natives were at work cutting
timber for the railway, which is entirely dependent on wood fuel. The
contractor in charge, a young English gentleman, who was described
to me as being a model employer of native labour in Government
contracts, had taken the trouble to cut a path through the forest
across a loop of the line in order that I might see what it was like
inside. Through this leafy tunnel, about a mile and a half long, we all
accordingly dived. There was nothing sinister in the aspect of this
forest, for all its density and confusion. The great giants towered up
magnificently to a hundred and fifty feet. Then came the ordinary
forest trees, much more thickly clustered. Below this again was a
layer of scrub and bushes; and under, around, and among the whole
flowed a vast sea of convolvulus-looking creeper. Through all this
four-fold veil the sunlight struggled down every twenty yards or so in
gleaming chequers of green and gold.
On the way the method of fuel-cutting is explained. So far as the
labourer is concerned, it is an elaborate system of piece-work, very
accurately and fairly adjusted, and, as is so often the case where the
white employer takes personal care of his men, there appeared to be
no difficulty in finding any number of natives. But they are a plaguey
company. Few will stay for more than a month or two, however
satisfied they may be with their work and its rewards; and just as
they begin to get skilful, off they go to their villages to cultivate their
gardens and their families, promising to come back another year, or
after the harvest, or at some other remote and indefinite date. And
meanwhile the railway must have its fuel every day and day after
day, with the remorseless monotony of the industrial machine.
But what a way to cut fuel! A floating population of clumsy
barbarians pecking at the trees with native choppers more like a toy
hoe than an axe, and carrying their loads when completed a quarter
of a mile on their heads to the wood-stack, while the forest laughs
at the feebleness of man. I made a calculation. Each of the nine
hundred natives employed costs on the whole six pounds a year. The
price of a steam tree-felling plant, with a mile of mono-rail tram
complete, is about five hundred pounds. The interest and sinking
fund on this capital outlay represent the wages of four natives, to
which must be added the salary of a competent white engineer,
equal to the wage of forty natives, and the working expenses and
depreciation roughly estimated at the wage of twenty natives more;
in all the wage of sixty-five natives. Such a plant, able to cut trees
six feet in diameter through in four or five minutes, to cut timber as
well as fuel, to saw it into the proper lengths for every purpose with
the utmost rapidity, and to transport it by whole truck-loads when
sawn to the railway siding, would accomplish a week's work of the
sixty-five natives it replaced in a single day, and effect a sevenfold
multiplication of power. It is no good trying to lay hold of Tropical
Africa with naked fingers. Civilization must be armed with machinery
if she is to subdue these wild regions to her authority. Iron roads,
not jogging porters; tireless engines, not weary men; cheap power,
not cheap labour; steam and skill, not sweat and fumbling: there lies
the only way to tame the jungle—more jungles than one.
On this we talked—or at least I talked—while we scrambled across
the stumps of fallen trees or waded in an emerald twilight from one
sunbeam to another across the creeper flood. It is of vital
importance that these forests should not be laid waste by reckless
and improvident hands. It is not less important that the Uganda
Railway should have cheap fuel. For a long time fuel alone was the
object, but now that an elaborate Forestry Department has been
established on the most scientific lines, there is a danger that
forestry will be the only object, and the cost of fuel so raised by
regulations, admirable in themselves, that the economy of the
Uganda Railway may be impaired. And let us never forget that the
Uganda Railway is the driving-wheel of the whole concern. What is
needed here, as elsewhere, is a harmonious compromise between
opposite and conflicting interests. That is all.
Presently our guide began to tell us of the strange creatures who
live in the forest, and are sometimes seen quite close by the fuel-
cutters—very rare antelope, enormous buffaloes, and astonishing
birds and butterflies beyond imagination. He had managed to make
friends with the Wandorobo—a tribe of forest-dwelling natives who
live plunged in these impenetrable shades, who are so shy that, if
once a stranger does but set eye upon their village, forthwith they
abandon it; yet who are at the same time so teased by curiosity that
they cannot resist peeping, peeping ever nearer and nearer to the
fuel-cutters, until one day commercial relations are established on
the basis of sugar for skins. I was just becoming interested in these
wood-squirrels when we broke into the hot blaze of the noonday sun
beating down on the polished railway track, and had to climb up on
to our cowcatcher in order to hurry on to a real steam saw-mill ten
miles farther up the line.
As the journey advances, the train mounts steadily higher and the
aspect of the country changes. The forest, which has hitherto lapped
the line closely on every side, now makes fair division with rolling
hills of grass. And there is this extraordinary feature about it: where
the forest areas end, they end abruptly. There is no ragged belt of
trees less thickly grown; no transition. Smooth slopes of grass run
up to the very edge of virgin forest, just as in England the meadow
runs to the edge of the covert. The effect is to make the landscape
surprisingly homelike. It is like travelling through a series of gigantic
parks, where the hand of man has for hundreds of years decided
exactly where trees shall grow and where they shall not.

Kavirondo Warriors at Kisumu.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like