Als pdf oder txt herunterladen
Als pdf oder txt herunterladen
Sie sind auf Seite 1von 59

Full download ebooks at ebook ebookstep.

com

Raspberry Pi Pico Schnelleinstieg mitp


Professional German Edition Thomas
Brühlmann

DOWLOAD EBOOK
OR CLICK LINK

http://ebookstep.com/product/raspberry-pi-pico-
schnelleinstieg-mitp-professional-german-edition-
thomas-bruhlmann/

Go to download the full and correct Download More ebooks [PDF].


content document Format PDF ebook download PDF
https://ebookstep.com KINDLE
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

■■■■■■■■■ ■■■ Raspberry Pi ■■■■■■■■■■■■ ■■■■■■■■■


Edition ■■■■ ■■■■

https://ebookstep.com/download/ebook-44570984/

Raspberry Pi Przewodnik u■ytkownika 3rd Edition Eben


Upton Gareth Halfacree Konrad Matuk

https://ebookstep.com/product/raspberry-pi-przewodnik-
uzytkownika-3rd-edition-eben-upton-gareth-halfacree-konrad-matuk/

Internet das Coisas com ESP8266 Arduino e Raspberry Pi


1st Edition Sérgio De Oliveira

https://ebookstep.com/product/internet-das-coisas-com-
esp8266-arduino-e-raspberry-pi-1st-edition-sergio-de-oliveira/

Baukosten sicher ermitteln Mit Praxisbeispiel


Mehrfamilienhaus Schnelleinstieg für Architekten und
Bauingenieure essentials German Edition Scholz

https://ebookstep.com/product/baukosten-sicher-ermitteln-mit-
praxisbeispiel-mehrfamilienhaus-schnelleinstieg-fur-architekten-
und-bauingenieure-essentials-german-edition-scholz/
■■■■■■■■■ ■■■ Raspberry Pi ■■■■■■■■■■■■ ■■■■■■■■■
■■■■■■■■■■ ■■■■■■■■■■■■■ ■■■■ ■■■■ ■■■■■■■ ■
■■■■■■■■■■■ ■■■■■■■ ■■■■■■■■

https://ebookstep.com/download/ebook-46098264/

Pi und die Primzahlen: Eine Entdeckungsreise in die


Mathematik (German Edition) Edmund Weitz

https://ebookstep.com/product/pi-und-die-primzahlen-eine-
entdeckungsreise-in-die-mathematik-german-edition-edmund-weitz/

Raspberry Pi dein Einstieg Der vielseitige Linux


Computer für Smarthome Entertainment Experimente 4th
Edition Matt Richardson & Shawn Wallace & Wolfram Donat

https://ebookstep.com/product/raspberry-pi-dein-einstieg-der-
vielseitige-linux-computer-fur-smarthome-entertainment-
experimente-4th-edition-matt-richardson-shawn-wallace-wolfram-
donat/

Sisis schöne Leichen Kaiserin Elisabeth ermittelt


German Edition Thomas Brezina

https://ebookstep.com/product/sisis-schone-leichen-kaiserin-
elisabeth-ermittelt-german-edition-thomas-brezina/

Basiswissen Usability und User Experience Aus und


Weiterbildung zum UXQB Certified Professional for
Usability and User Experience 2nd Edition Thomas Geis

https://ebookstep.com/product/basiswissen-usability-und-user-
experience-aus-und-weiterbildung-zum-uxqb-certified-professional-
for-usability-and-user-experience-2nd-edition-thomas-geis/
Thomas Brühlmann

Raspberry Pi Pico
Schnelleinstieg
Impressum

Bibliografische Information der Deutschen Nationalbibliothek


Die Deutsche Nationalbibliothek verzeichnet diese Publikation in der Deutschen
Nationalbibliografie; detaillierte bibliografische Daten sind im Internet über
<http://dnb.d-nb.de> abrufbar.
ISBN 978-3-7475-0379-9
1. Auflage 2021
www.mitp.de

E-Mail: [email protected]
Telefon: +49 7953 / 7189 - 079
Telefax: +49 7953 / 7189 - 082
© 2021 mitp Verlags GmbH & Co. KG
Dieses Werk, einschließlich aller seiner Teile, ist urheberrechtlich geschützt. Jede
Verwertung außerhalb der engen Grenzen des Urheberrechtsgesetzes ist ohne
Zustimmung des Verlages unzulässig und strafbar. Dies gilt insbesondere für
Vervielfältigungen, Übersetzungen, Mikroverfilmungen und die Einspeicherung und
Verarbeitung in elektronischen Systemen.
Die Wiedergabe von Gebrauchsnamen, Handelsnamen, Warenbezeichnungen usw.
in diesem Werk berechtigt auch ohne besondere Kennzeichnung nicht zu der
Annahme, dass solche Namen im Sinne der Warenzeichen- und Markenschutz-
Gesetzgebung als frei zu betrachten wären und daher von jedermann benutzt
werden dürften.
Lektorat: Sabine Schulz
Sprachkorrektorat: Petra Heubach-Erdmann
Covergestaltung: Janina Bahlmann, Christian Kalkert
Coverbild: Thomas Brühlmann
Electronic Publishing: Petra Kleinwegen
Dieses Ebook verwendet das ePub-Format und ist optimiert für die Nutzung mit
dem iBooks-reader auf dem iPad von Apple. Bei der Verwendung anderer Reader
kann es zu Darstellungs­problemen kommen.
Hinweis des Verlages zum Urheberrecht und Digitalen Rechtemanagement (DRM)
Der Verlag räumt Ihnen mit dem Kauf des ebooks das Recht ein, die Inhalte im
Rahmen des gel­tenden Urheberrechts zu nutzen. Dieses Werk, einschließlich aller
seiner Teile, ist urheberrechtlich geschützt. Jede Verwertung außerhalb der engen
Grenzen des Urheherrechtsgesetzes ist ohne Zustimmung des Verlages unzulässig
und strafbar. Dies gilt insbesondere für Vervielfälti­gungen, Übersetzungen,
Mikroverfilmungen und Einspeicherung und Verarbeitung in elektroni­schen
Systemen.
Der Verlag schützt seine ebooks vor Missbrauch des Urheberrechts durch ein
digitales Rechtemanagement. Bei Kauf im Webshop des Verlages werden die
ebooks mit einem nicht sichtba­ren digitalen Wasserzeichen individuell pro Nutzer
signiert.
Bei Kauf in anderen ebook-Webshops erfolgt die Signatur durch die Shopbetreiber.
Angaben zu diesem DRM finden Sie auf den Seiten der jeweiligen Anbieter.
Inhalt

Impressum

Kapitel 1
Das Board
1.1 Die Leiterplatte
1.2 Anschlüsse
1.3 Spannungsversorgung

Kapitel 2
Die Software
2.1 Thonny-Entwicklungsumgebung (IDE)
2.1.1 Installation von Thonny
2.1.2 Konfiguration von Thonny
2.2 MicroPython
2.2.1 MicroPython für Raspberry Pi Pico
2.2.2 Installation von MicroPython
2.2.3 MicroPython in Thonny IDE

Kapitel 3
Erste Schritte
3.1 Erstes Programm
3.2 Projekt »Blink LED«
3.3 Programmaufbau
3.4 Steckbrett und Elektronik
3.4.1 Steckbrett
3.4.2 Bauteile der Elektronik

Kapitel 4
Digitale Ein- und Ausgänge
4.1 Ein- und Ausgänge am Pico
4.2 Eingang einlesen
4.2.1 Pullup oder Pulldown
4.3 Praxisbeispiel: Taster einlesen und Status ausgeben
4.4 LED ansteuern
4.5 PWM
4.5.1 Praxisbeispiel: LED mit PWM
4.6 Servo
4.6.1 Praxisbeispiel: Servo mit Potentiometer
4.7 Transistor, Relais
4.7.1 Transistor
4.7.2 Relais
4.8 Motor
4.8.1 Einfache Motor-Stufe (ein Motor)
4.8.2 Motor-Treiber für zwei Motoren
4.8.3 Praxisbeispiel: Motor-Ansteuerung (1 Motor)
4.8.4 Praxisbeispiel: Motor-Ansteuerung (2 Motoren)
4.8.5 Praxisbeispiel: Mini-Roboter

Kapitel 5
Analoge Welt
5.1 Spannung einlesen
5.1.1 Praxisbeispiel: Messung mit dem internen
Temperatursensor
5.2 Praxisbeispiel: Poti mit LED-Ampel
5.3 Praxisbeispiel: Lichtmesser mit LDR
5.4 Praxisbeispiel: Temperaturmessung mit NTC

Kapitel 6
Anzeigen
6.1 RGB-LED
6.2 LC-Display (LCD)
6.3 OLED-Display
6.4 Projekt: Wetterstation mit Umweltsensor DHT22

Kapitel 7
Schnittstellen
7.1 UART
7.1.1 Praxisbeispiel: Datenaustausch mit Arduino
7.2 I2C
7.2.1 I2C-Bus auf dem Pico
7.2.2 Definition I2C mit MicroPython
7.2.3 I2C-Scanner
7.3 Praxisbeispiel: Lichtmesser mit BH1750

Kapitel 8
Programm-Erweiterungen
8.1 Bibliotheken
8.2 Programmable Input and Output (PIO)
8.2.1 Praxisbeispiel: Blink mit State Machine
8.2.2 Praxisbeispiel: Blinker als Alarmmelder
Kapitel 9
Pinout und Boards
9.1 Pico-Pinout und Beschreibung
9.2 Technische Daten
9.3 RP2040-Boards
9.3.1 Sparkfun
9.3.2 Arduino
9.3.3 Adafruit
9.3.4 PIMORONI
9.4 Hardware-Erweiterungen
9.4.1 Reset-Schalter
9.4.2 Pico-Pinout-Board für Steckbrett

Kapitel 10
Stücklisten
Einführung

Im Januar 2021 hat eine News-Meldung die Maker- und Bastlerszene


überrascht. Die Raspberry Pi Foundation, also die Organisation, die
den bisher bekannten Minicomputer Raspberry Pi entwickelt hat,
präsentierte ein neues Mitglied in ihrer Produkte-Reihe. Willkommen
Raspberry Pi Pico!
Die Vorstellung des neuen Raspberry Pi Pico, in diesem Buch in der
Kurzform »Pico«, wurde unbemerkt im Hintergrund vorbereitet und
nur wenige Hardware-Hersteller aus dem Maker-Umfeld waren
informiert. Zu diesen Anbietern gehören Adafruit, Sparkfun, Arduino
und Pimoroni. Diese Hardware-Firmen präsentieren mit der
Vorstellung des Pico gleichzeitig eigene kompatible Boards und
Lösungen. Diese Lösungen sind zum aktuellen Zeitpunkt (März 2021)
noch in Entwicklung. Die bisher präsentierten Informationen zu den
neuen Boards werden viele Maker, Bastler und Microcontroller-Board-
Anwender erfreuen.
Dank der zeitlich geplanten Vorstellung des Pico ist das neue
Microcontroller-Board bereits bei einzelnen Händlern und Online-
Shops verfügbar. Abonnenten und Käufer der Ausgabe 39 der
englischen Bastlerzeitschrift HackSpace (http://hsmag.cc) erhielten
zusätzlich zur Zeitschrift ein Pico-Board. Leider war diese Aktion breit
gefächert nur auf der englischen Insel verfügbar. Glückliche Besitzer
haben sich vielleicht auch an einem Zeitschriftenshop auf einem
Flughafen eine Ausgabe mit Board sichern können.
Da Sie dieses Buch gekauft haben, gehören Sie vermutlich auch zur
Maker-Community und interessieren sich für das neue Board der
Raspberry Pi Foundation und möchten gerne interaktive
Anwendungen mit Schalter, Anzeigen, Motoren usw. realisieren.
Möglicherweise haben Sie bereits erste Erfahrungen mit
Microcontrollern wie Arduino gemacht.
Der neue Raspberry Pi Pico ist im Gegensatz zu seinen Geschwistern
aus der Raspberry-Serie kein Minicomputer mit Betriebssystem,
sondern ein kleines, kompaktes Microcontroller-Board, auf dem
Programme in MicroPython oder C/C++ ausgeführt werden können.
Mit der Vorstellung des Pico sind die News aber noch nicht fertig
erzählt. Neben dem neuen Microcontroller-Board gibt es auch einen
neuen Microcon­troller. Auf dem Pico wird ein eigener, von der
Raspberry Pi Foundation entwickelter Chip eingesetzt – der
Microcontroller hat die Bezeichnung RP2040.
Diese spannenden Neuigkeiten bringen wieder Schwung in die
Maker-Szene. Ein neues Microcontroller-Board, das einen solch
markanten Eindruck in der Szene und in den sozialen Medien
hinterlässt, erscheint nicht täglich. Obwohl erst kurze Zeit seit der
Präsentation des Pico vergangen ist, findet man auf den bekannten
sozialen Plattformen wie Twitter, YouTube und Hackaday schon eine
ganze Menge an nützlichen Informationen, Beispielen und Tutorials.
Täglich kommen neue Projekte dazu und erweitern so die
Möglichkeiten des kleinen Boards.
Dieser kompakte Guide soll Sie beim Einstieg ins Thema Raspberry
Pi Pico und MicroPython unterstützen. Idealerweise haben Sie schon
mit anderen Microcontroller-Boards gearbeitet und schon
Grundkenntnisse in Python oder einer anderen Programmiersprache.
Das Buch ist so aufgebaut, dass Sie die Kapitel nacheinander
durcharbeiten können.
In Kapitel 1 wird der Raspberry Pi Pico vorgestellt, die Anschlüsse
erklärt und die technischen Daten und Funktionen vorgestellt.
In Kapitel 2 wird die Firmware der Programmiersprache MicroPython,
eine kompakte und abgespeckte Version von Python, installiert.
Anschließend wird die Entwicklungsumgebung Thonny installiert und
konfiguriert. Nach dem Verbindungsaufbau zwischen der
Entwicklungsumgebung und dem Pico steht die nötige Infrastruktur
bereit.
Das erste Programm, im Hardware-Umfeld ein Blink-Programm, wird
in Kapitel 3 erstellt und auf den Pico geladen. Anschließend werden
die Struktur der Programme und der Programmaufbau erklärt.
Gleichzeitig werden die nötige Elektronik und Hardware, die für die
nachfolgenden Beispiele verwendet werden, erläutert.
Das Kapitel 4 beschreibt den Einsatz der digitalen Ein- und Ausgänge
des Pico. In praktischen Beispielen werden die Zustände von Tastern
eingelesen und Leuchtdioden, Servos und Relais angesteuert.
Die analoge Welt mit den integrierten Analog/Digital-Wandlern wird
in Kapitel 5 vorgestellt. Analoge Sensoren wie Fotowiderstand und
Temperatursensor werden in Betrieb genommen.
In Kapitel 6 werden Anzeige-Elemente eingesetzt. Zuerst wird eine
Leuchtdiode als optisches Element über eine Dimm-Funktion
angesteuert. Anschließend erklären Praxisbeispiele den Einsatz von
LC- und OLED-Displays. Zum Schluss wird eine kleine Wetterstation
realisiert.
Kapitel 7 beschreibt den Einsatz der seriellen Schnittstelle (UART)
und des I2C-Bus. In einem Praxisprojekt wird ein Lichtmesser
realisiert.
In Kapitel 8 werden Programmerweiterungen wie die State-Machine
und Module und Bibliotheken beschrieben.
Kapitel 9 beinhaltet technische Themen wie die Beschreibung des
Pinouts und der einzelnen Anschluss-Pins sowie technische Daten
zum Pico und dem M ­ icrocontroller RP2040.
Alle Stücklisten zu den einzelnen Projekten werden in Kapitel 10
bereitgestellt.

Weitere Informationen
Weitere Informationen zum Buch und zu den Projekten mit dem
Raspberry
Pi Pico sind auf meiner Website erhältlich:
https://555circuitslab.com
Die Beispielprogramme aus dem Buch können über meinen Github-
Account bezogen werden:
https://github.com/arduinopraxis
Auf meiner Website findet man auch weitere Informationen zu
meinen Microcontroller-Projekten wie auch Details zu meinen
Büchern über die Themen Arduino und Sensoren.
Auf der Website des Verlages sind Informationen zu diesem Buch
unter folgender Adresse verfügbar:
https://mitp.de/0377

Kontakt zum Autor


Anregungen, Rückmeldungen und Fragen können Sie über Twitter
oder per E-Mail an mich senden.
E-Mail: [email protected]
Twitter: https://twitter.com/arduinopraxis

Danksagung
Ein großer Dank geht an meine Familie, meine Frau Aga und meine
Jungs Tim und Nik. Auch bei diesem Buchprojekt haben sie mir
wieder den nötigen Freiraum gegeben.
Herzlichen Dank an meine Lektorin Sabine Schulz für den
unkomplizierten und schnellen Ablauf bei der Entstehung dieses
Buchprojekts.
Im Mai 2021
Thomas Brühlmann
Kapitel 1
Das Board

In diesem Kapitel werden die Hardware des Raspberry Pi Pico, die


Anschlüsse und die Spannungsversorgung beschrieben.

1.1 Die Leiterplatte


Der Raspberry Pi Pico ist das bisher kleinste Board der Raspberry-Pi-
Familie und hat eine Größe von 50 x 20 mm. Der Pico wird als kleine
Leiterplatte mit seitlichen Anschlüssen geliefert. In Abbildung 1.1 ist
der Raspberry Pi Pico zu sehen.

Abb. 1.1: Raspberry Pi Pico

Die wichtigsten Komponenten des Raspberry Pi Pico sind in


Abbildung 1.2 farbig dargestellt.
Abb. 1.2: Raspberry Pi Pico – Komponenten des Boards

Microcontroller
Die Zentraleinheit, also das Gehirn des Pico, ist der Microcontroller
vom
Typ RP2040. Dieser Microcontroller wurde von der Raspberry Pi
Foundation eigens für dieses neue Board entwickelt. Die technischen
Daten zum Board und dem Microcontroller sind in Kapitel 9
beschrieben.
Im Gegensatz zu den bisherigen Raspberry-Pi-Boards kann auf dem
Pico kein Betriebssystem betrieben werden. Auf den Microcontroller
wird eine Firm­ware geladen, die anschließend einzelne Programme
ausführt. In diesem Buch wird der Einsatz von MicroPython
beschrieben.

Ein- und Ausgänge


Über die goldenen Anschlusspads oder Lötflächen auf den
Längsseiten können die externen Bauteile angeschlossen werden.
Dabei kann ein einzelner Anschlussdraht oder eine Stiftleiste
angelötet werden.
In der Praxis lohnt sich das Anlöten einer 20-poligen Stiftleiste.
Dabei werden die Anschluss-Pins von der Unterseite des Pico
aufgesteckt und an der Oberseite der Leiterplatte angelötet. In
Abbildung 1.3 sind die Stiftleisten angelötet. Anschließend wurde der
Pico auf ein Steckbrett aufgesteckt.
Das Anlöten von Stiftleisten für den Einsatz auf einem Steckbrett
kennen Sie vielleicht schon von anderen Microcontroller-Boards wie
dem Arduino Nano.
Die Anschlussbelegung des Pico ist im nachfolgenden Abschnitt
beschrieben.

Abb. 1.3: Raspberry Pi Pico mit Stiftleisten auf Steckbrett


USB-Anschluss
Mit dem Anschließen eines USB-Kabels an den USB-Anschluss
(Micro-USB-Typ B) wird der Raspberry Pi Pico mit Spannung
versorgt. Gleichzeitig erfolgt über diese USB-Verbindung der
Datenaustausch vom Pico zum angeschlossenen Rechner. Dazu
gehört auch das Hochladen von neuen Programmen auf den Pico.

Onboard-LED
Die Onboard-LED ist intern am Ausgangspin GP25 des RP2040
angeschlossen und kann für Statusanzeigen verwendet werden.

Boot-Selektor
Der Boot-Selektor ist ein Drucktaster zur Selektion des Startmodus.
Der Boot-Selektor wird später noch verwendet und beschrieben.

Debug-Schnittstelle
Die drei Anschluss-Pads mit der Bezeichnung Debug sind für die
fortgeschrittene Fehlersuche, das sogenannte Debugging,
herausgeführt. Die Schnittstelle wird als ARM-Serial-Wire-Debug-
(SWD-)Schnittstelle bezeichnet. Die Verwendung dieser Schnittstelle
ist in diesem Buch nicht beschrieben.

1.2 Anschlüsse
Die Anschluss-Pins des Pico sind an allen vier Seiten der Leiterplatte
angeordnet. An den Längsseiten findet man alle Ein- und Ausgänge,
um externen Komponenten wie Schalter, Taster, Leuchtdioden,
Sensoren oder Anzeigen anzuschließen.
In Abbildung 1.4 ist die Anschlussbelegung (Pinout) mit den
verschiedenen Funktionen der einzelnen Pins dargestellt. Die
Funktionen werden zusätzlich mit einzelnen Farben gezeigt. Die Ein-
und Ausgänge für übliche GPIO-­Funktionen, also allgemeine Ein-
und Ausgänge, sind hellgrün. Die vier analogen Eingänge sowie die
interne Referenzspannung sind dunkelgrün markiert.

Abb. 1.4: Pico – Anschlussbelegung (Quelle: Website Raspberry Pi Foundation)

Durch die vielen Anschluss-Pins und die verschiedenen Funktionen


muss beim Anstecken einer Drahtverbindung immer genau geprüft
werden, ob man den richtigen Pin verwendet. Leider ist die
Pinbelegung nur auf der Rückseite des Raspberry Pi Pico aufgedruckt
( Abbildung 1.5).
Abb. 1.5: Anschlussbelegung auf Rückseite

Wie bereits im vorherigen Abschnitt erwähnt, empfiehlt es sich, zwei


20-polige Stiftleisten an den seitlichen Anschlusspads anzulöten.
Ich habe mir für die sichtbare Anzeige der Anschlussbelegung eine
kleine Leiterplatte entwickelt. Diese kann von unten an die Stiftleiste
angeschlossen werden (Abbildung 1.6).
Abb. 1.6: Leiterplatte mit Anschlussbelegung

Stückliste (Anschluss-Pins)
1 Raspberry Pi Pico
2 Stiftleisten 1 x 20 Pin
Lötzinn
Lötkolben (30 bis 50 Watt)
Im ersten Schritt wird das Board von oben auf die Stiftleisten
gesteckt.
Als Hilfe für die Positionierung der Stiftleisten kann auch eine
unbestückte Lochrasterplatine verwendet werden( Abbildung 1.7).
Anschließend lötet man je einen Pin der beiden Stiftleisten von oben
an. Um die Stiftleiste gerade zu zentrieren, muss man allenfalls den
Pin nochmals erhitzen und mit der Hand die Position korrigieren.
Bevor man nun alle Pins der Stiftleiste anlötet, kann man das Board
auf ein Steckbrett platzieren und so prüfen, ob die Stiftleisten
geradestehen.
Beim Anlöten der Stiftleiste dürfen die Lötpads nicht zu lange erhitzt
werden, da andernfalls aufgelötete Bauteile auf der Leiterplatte des
Pico durch die Hitze verschoben werden.

Abb. 1.7: Stiftleisten anlöten

In vielen Tutorials und Anleitungen wird beschrieben,


dass man die Stiftleisten am Pico anlöten soll, wenn
diese im Steckbrett eingesteckt sind. Ich empfehle
diese Variante nicht, da beim Löten Hitze entsteht, die
den Kunststoff des Steckbretts angreifen kann. Falls
man ein Steckbrett zur Verfügung hat, das nur für
Lötarbeiten verwendet wird, kann diese Lösung
trotzdem verwendet werden.

Für den praktischen Einsatz und für die Entwicklung von


Anwendungen kann der Pico auch auf eine stabile Grundplatine
gesteckt werden.
Zum aktuellen Zeitpunkt (März 2021) stehen aber erst wenige
solcher Lösungen zur Verfügung. Als Beispiel kann das Grove Shield
für Pi Pico von Seeedstudio erwähnt werden (Abbildung 1.8):
https://www.seeedstudio.com/Grove-Shield-for-Pi-
Pico-v1-0-p-4846.html

Abb. 1.8: Grove Shield für Pi Pico (Bild Seeedstudio)

Für meine Anwendungen habe ich ein kleines Protoboard mit


Stiftleisten für den Pico sowie vielen freien Lötpads erstellt
(Abbildung 1.9).
Abb. 1.9: Protoboard für Pico

Die Leiterplatte ist in meinem Shop verfügbar:


https://www.tindie.com/products/23201/

1.3 Spannungsversorgung
Auf dem Raspberry Pi Pico ist eine Spannungsversorgungsschaltung
aufgebaut, die die internen 3,3 V generiert. Die Eingangsspannung
für diese Versorgung kann dabei im Bereich von 1,8 V bis 5,5 V
liegen.
Durch diesen großen Spannungsbereich kann der Raspberry Pi Pico
zukünftig auch mit einem einzelnen Lipo-Akku oder über mehrere
AA-Batterien versorgt werden.
Falls der Pico über eine externe Spannungsquelle versorgt wird,
muss die Versorgungsspannung über den Anschluss VSYS zugeführt
werden.
Für fortgeschrittene Anwender sind dazu im Datenblatt des
Raspberry Pi Pico etliche Anwendungs-Beispiele beschrieben.
Kapitel 2
Die Software

In diesem Kapitel wird die Entwicklungsumgebung Thonny IDE


installiert und die Firmware MicroPython auf den Raspberry Pi Pico
geladen. Anschließend kann das erste MicroPython-Programm auf
den Pico geladen werden.
MicroPython ist nur eine Option, wenn es um die Programmierung
von ­Microcontroller-Boards geht. Weitere mögliche
Programmiersprachen sind C/C++ oder CircuitPython.
In diesem Buch wird MicroPython, das von der Raspberry Pi
Foundation als Python-Variante gewählt wurde, installiert und mit
vielen Beispielen beschrieben.

2.1 Thonny-Entwicklungsumgebung
(IDE)
Die Software Thonny ist eine einfache und beliebte
Entwicklungsumgebung, in Englisch IDE (Integrated Development
Environment) genannt, für die Programmierung von Python und
MicroPython.
Die Software kann kostenlos von der Thonny-Website geladen
werden.

2.1.1 Installation von Thonny


Gehen Sie auf die Website thonny.org und laden Sie sich die Thonny-
Version für Ihr Betriebssystem herunter. Zum aktuellen Zeitpunkt ist
dies die Version 3.3.3.
Falls Sie planen, die Pico-Entwicklung auf einem Raspberry Pi mit
Raspberry Pi OS auszuführen, müssen Sie nichts unternehmen.
Thonny ist nämlich bereits auf dem System installiert.
Andernfalls installieren Sie nach dem Download Thonny auf Ihrem
System, indem Sie den Anweisungen des Installers folgen.
Nachdem die Software installiert ist, kann die Thonny IDE gestartet
werden. Die Entwicklungsumgebung öffnet sich mit einem leeren
Codefenster. Unterhalb der Menüpunkte ist der Bereich der Code-
Eingabe (grün markiert) angeordnet. Unterhalb des Code-Bereichs
liegt die Shell (rot markiert). Über die Shell können Code-
Anweisungen direkt ausgeführt werden und gleichzeitig werden in
der Shell Status-Meldungen und Informationen ausgegeben
(Abbildung 2.1). In der Standard-Einstellung nach der Installation
wird die Python-Version angegeben.
Abb. 2.1: Thonny-Entwicklungsumgebung

2.1.2 Konfiguration von Thonny


Nach der erfolgreichen Installation von Thonny öffnet sich die
Anwendung mit einem leeren Code-Blatt. Als Standard-Interpreter ist
Python 3.7 eingestellt, was man über die Shell unterhalb des
Codefensters erkennen kann.
Mit der Eingabe einer Testzeile in der Shell kann Python getestet
werden.
Geben Sie
print("Hello Python")

ein und es wird eine Python-Ausgabe des Textes ausgeführt


(Abbildung 2.2).

Abb. 2.2: Thonny IDE – Test Python

Nun muss noch der MicroPython-Interpreter für Pico eingestellt


werden.
Gehen Sie im Hauptmenü auf Run|Select interpreter und wählen Sie
den Interpreter für den Pico aus (Abbildung 2.3).
Abb. 2.3: Thonny IDE – Interpreter MicroPython für Pico

Unter der Auswahl Port kann der Port eines angeschlossenen


Raspberry Pi Pico ausgewählt werden.
Nach Bestätigen mit OK ist die Installation von Thonny
abgeschlossen.

2.2 MicroPython
Python ist eine Programmiersprache für Desktop- und
Serveranwendungen und wurde in den 90er-Jahren entwickelt und
nach der bekannten Comedy-Truppe »Monty Python« benannt.
Python ist momentan sehr beliebt und kann als aufstrebende
Programmiersprache bezeichnet werden.
MicroPython ist eine Python-kompatible Programmiersprache und
wurde speziell für den Einsatz mit Microcontrollern entwickelt und
optimiert. Die offizielle Implementation von MicroPython basiert auf
dem Python-3.4-Befehlssatz.
Wenn Sie also bereits mit Python programmiert haben, wird Ihnen
bei MicroPython ziemlich viel bekannt vorkommen und der Umgang
damit wird Ihnen leichtfallen. Die Beispiele sind aber so aufgebaut,
dass Sie auch als Einsteiger die Programme verstehen.
Für den Einsatz auf Microcontrollern, in unserem Fall dem Raspberry
Pi Pico, muss eine Firmware auf das Microcontroller-Board geladen
werden.
MicroPython-Programme können in der Entwicklungsumgebung oder
direkt auf dem Board gespeichert ausgeführt werden.

2.2.1 MicroPython für Raspberry Pi Pico


MicroPython für den Pico steht auf der Website des Raspberry Pi
Pico zum Download bereit:
https://www.raspberrypi.org/documentation/pico/ge
tting-started/
Folgen Sie dem Link Getting started with MicroPython (Abbildung 2.4).

Abb. 2.4: MicroPython für Pico


In Abbildung 2.5 sehen Sie den Download der Firmware in Form
einer UF2-Datei.

Abb. 2.5: MicroPython – Download UF2-Datei

Die aktuelle Version der heruntergeladenen Datei steht dann im


Download-Ordner Ihres Betriebssystems zur Verfügung (Abbildung
2.6).
Abb. 2.6: UF2-Datei im Download-Ordner

2.2.2 Installation von MicroPython


Nach dem Download der UF2-Datei muss diese nun auf den Pico
geladen werden.
Im ersten Schritt nehmen Sie den Pico zur Hand, drücken die Boot-
Selektor-Taste (auf dem Pico mit BootSEL bezeichnet).
Halten Sie die Taste gedrückt und verbinden Sie den Pico über das
USB-Kabel mit Ihrem Rechner (Abbildung 2.7).
Abb. 2.7: MicroPython auf den Pico laden – Taste bootsel drücken.

Nach dem Verbinden des USB-Kabels kann die Taste bootsel


losgelassen werden.
Nun öffnet sich in Ihrem Filesystem ein Explorer-Fenster mit einem
neuen Massenspeicher RPI-RP2 (Abbildung 2.8).

Abb. 2.8: MicroPython auf den Pico laden (Massenspeicher)


Another random document with
no related content on Scribd:
actually crippled or suffering from a loathsome disease called craw-
craw, which bears some resemblance to the mange in dogs or
horses. In appearance and personal strength they are much inferior
to most other Africans; probably from their great indolence and want
of exercise. The wives are treated with great harshness by their
husbands, in case they offend them.
They have no ingenuity, but a considerable power of imitation.
Some of our British manufactured articles in wood or gold they can
imitate very fairly, but when closely examined, their work will always
be found to be defective. They seem never to improve by their own
ingenuity, but always remain stationary in any art or trade which they
have learnt. They seem to have no idea of a straight line, and cannot
build a wall straight, or make a hedge in a direct line; nor in the
whole neighbourhood of Cape Coast is there a footpath in a straight
line for the distance of twenty yards, although the ground is quite
level. They certainly possess many strange ideas.
There are in the neighbourhood of Cape Coast some strange
animals, among which is the Patakoo, a very large species of wolf.
These are so ravenous as frequently to come down into the town
and carry away pigs, sheep, and goats. They pay nightly visits to the
beach, and seize on dead bodies which have been buried in the
sand. As their slaves have no relations in the town or
neighbourhood, as soon as they die their corpses are tied up in a
coarse grass mat and thrown into a hole in the sand, without any
ceremony; but on the same or following night, they are snatched up
by the Patakoos, for whom they make a glorious feast. This beast
has great strength, its size considered. When Governor Hill’s horse
died, the officers of the First West India Regiment, stationed at Cape
Coast, determined to leave part of its carcase on the beach, in order
to attract the Patakoos, and it could not have lain there more than an
hour before it was removed by a single Patakoo, though it was two
men’s work to carry it.
There is plenty of excellent granite and sandstone at Cape Coast;
yet nearly all the houses are built of clay, as the people are too lazy
to fetch the stone. Elmina, which is only eight miles distant, is a
much superior settlement, and has likewise plenty of excellent
sandstone, of which a great number of its houses are built. This
place belongs to the Dutch, and carries on much trade, both with the
interior and along the coast. It has a fine lake, connected with the
sea by a narrow channel, which might with very little trouble be
converted into a convenient harbour, which would be important, as
the swell along the Gold Coast is always very heavy, and great
difficulty is experienced in shipping and unshipping goods. I visited
several of the most influential merchants at Elmina, and found them,
as well as the governor, very hospitable. The abundance of new
plants in this country would give plenty of employment to a botanist.
A small shrub of the laurel tribe, bearing a white delicate flower,
shaped like the blossom of the pea, grows here very plentifully, as
also beautiful jasmines and honeysuckles, and several sorts of
sensitive plants. Some very fine grasses, also in this neighbourhood
struck me, but I did not observe many small annuals.
Agriculture has made little progress here, probably owing to the
want of horses, which cannot live more than a few weeks, and from
the indolence of the natives. Stock sufficient for the consumption of
the garrisons along the coast might be raised with a little care and
exertion. The number of troops along the whole of the west coast is
at present very small. Were their numbers doubled, there would not
be too many, and they might be employed alternately in cultivating
the farms and mounting guard in the forts. Yams, manioc, Indian
corn, rice, and all sorts of vegetables, for the garrison and ships of
war cruising on the coast, might in this way be easily obtained, and
much expense avoided. This would also be useful as a pattern to the
natives. The troops are paying at present one shilling per pound for
meat, which could easily be raised at one-fourth, and the cattle might
be employed on the farm instead of horses. An establishment of this
sort would be very beneficial here, and I have no doubt would
answer the purpose well. Unfortunately at present there seems to be
no European at Cape Coast who either knows or interests himself in
anything relating to agriculture. With the exception of Mr. Hutton, not
a single English merchant at Cape Coast has even a garden,
although the progress of vegetation is incredibly rapid. Some seeds
of the vegetable marrow and water melon, given to me by Dr. Lindley
of the Horticultural Society in London, which were sown on my arrival
at Cape Coast, had grown to the extent of twenty-four feet in two
months, and the fruit of the water melon was as large as a man’s
head.
The heat of the month of November is excessive. On the 8th, the
quicksilver in the thermometer, in my bedroom, which is considered
to be cool, stood at 88°; and in the sun it rose to 115°; yet, thank
God! I was so well accustomed to it, that I felt very little
inconvenience, though generally out the whole day, and exposed to
the sun. I was then daily expecting a messenger from Ashantee, for
one of the soldiers from the fort had been despatched by the
governor, to ask whether the King would allow me to pass beyond
his kingdom towards the Kong Mountains. During the interval I was
engaged in laying out the ground for Mr. Hutton’s model farm.
The breed of cattle here is very handsome though small, but it
might be greatly improved, and this would repay the expense very
well, as the price of meat is so extremely high. Gold dust,
unfortunately, seems to be the only thing thought of on the coast.
Schools of industry and agriculture are wanted on this coast more
than any thing else. As land can be got for nothing anywhere on the
coast,—land capable of growing any thing,—a few hundred pounds
expended on a farm of three hundred acres would be very profitably
laid out. There are plenty of men who can read and write, begging
for employment; and ten times their number, from the bush, such as
might be deemed capable of learning, might be apprenticed to
different kinds of trades for four or five years.
It is worthy of remark, that on the whole coast, from Cape Palmas
to Accra, there is not a single shoemaker, although no trade seems
to be so much wanted. Even the natives in the interior complain
much of the want of shoes. Nor is there a tailor, a cabinet-maker, a
wheelwright, or a blacksmith who can weld a piece of iron with any
neatness in the whole settlement. Such articles, if manufactured on
the coast, would draw trade from the interior, and excite the natives
to industry; and thus British manufactures would be soon in great
demand in the interior also. This would greatly reduce the Slave
trade, as the minds of the people would be directed to agriculture
and manufactures, particularly as it is well known that even in the
Ashantee country the population is not on the increase. The
Ashantees have indeed, for the last two months, been at war with
the tribes to the north of them, bordering on the Kong Mountains,
and have lost a great number of men, as their enemies, who have no
fire-arms, no doubt did also.
The merchants of Cape Coast, Annamaboe, and Accra,
experience great loss and inconvenience, in consequence of the
trade being stopped between Ashantee and the coast. This was
occasioned by the murder of an Ashantee woman by a Fantee, on
her return from a trading journey to the coast. She had occasion to
stop a little behind her companions, and was then robbed and
murdered by this Fantee who overtook her. Her companions missing
her, went back, and found her with her head nearly severed from her
body. This took place in the Fantee country, between Cape Coast
and Ashantee. The murderer, however, was seized and brought part
of the way back to Cape Coast by a soldier from thence, on his way
with the letter to the King of Ashantee, from Governor Hill, which I
mentioned above.
Mr. Chapman, who had resided as missionary at Coomassie, the
capital of Ashantee, for the last twelve months, arrived at
Annamaboe on the 26th of November, 1844, with the intelligence
that all the King required was that the murderer should be punished
according to the English law. The King at that time expressed a great
desire to see me in Ashantee, and promised me complete protection
in his country; but said nothing about allowing me to go further.

FOOTNOTES:
[2] Fetish is corrupted from the Portuguese feitiço, witchcraft,
conjuring.
[3] His Majesty had served several years on board a British
man-of-war, previously to attaining his sovereignty.
CHAPTER III.
Annamaboe—State of the Fort—Indolence of the Natives,
and Difficulty in procuring Labourers—Domestic Slavery—
Missionary Schools—Want of Education in the Useful Arts—
Hints on this Subject—Vegetables and Fruits—Town of
Annamaboe—Soil—Natives—Reception of me by the King,
and Conversation with him—Mr. Brewe—Mr. Parker—
Excessive Heat—Little Cromantine, its impregnable Situation
—The Fort—Cromantine—The Market-place—Extraordinary
Tradition—Wonderful Dwarf—An Adventure—Accra—
Wesleyan Missionaries—Natives—their Habitations—Wives
and Slaves—Situation of the Town, and Soil.
On Monday, 23d of November, 1844, Mr. T. Hutton and I started
from Cape Coast for Annamaboe, a town of considerable trade on
the coast, about thirteen miles from Cape Coast Castle, from which
its magnetic bearing is about due east. It has also a very good fort,
which, however, is gradually going to decay. Its ramparts are well
supplied with artillery, and capable of making a good defence against
an attack from the sea, if properly garrisoned, and it is quite
impregnable by the natives from the land, or north side. It was at this
place that the Ashantees made so determined an attack, and an
attempt to blow up the gate of the fort. They, however, failed in all
their attempts during the late war of 1817. There are at present only
two or three private soldiers and a sergeant of militia in charge of the
garrison. Some of the apartments in the garrison are in a pretty good
state of repair, and might be very profitably used in more ways than
one, if from one hundred and fifty to two hundred militia-men were
stationed here, and employed by turns in managing a farm in the
immediate neighbourhood: the soil is capable of producing every
thing necessary for the support of the garrison. In three or four years,
on such a plan, this garrison would pay its own expenses.
The native kings or chiefs, and caboceers, are never to be
depended upon; and even the humblest of the natives, when they
imagine they have any power, although naturally great cowards, will
bully and be very insolent. The natives are so lazy that at times the
merchants cannot, without great difficulty, get men to load or unload
their ships. This is a very serious grievance, and often exposes our
merchants to great difficulties as well as loss. Were our merchants
allowed to hold as many slaves as are requisite for the performance
of domestic duties, and the carrying on of their business, it would act
as a check to the exportation of slaves.
I have minutely observed and inquired into the state and condition
of domestic slavery amongst the native caboceers, and I solemnly
declare that their condition is much superior to that of our English
peasantry. One English labourer, on an average, does more work
than any twelve Africans; and the provision of the latter being so
cheap (one penny per day is sufficient for their support), they have
always plenty to eat. I am writing from actual observation, having
had for three months a number of hired men under my charge.
Another evil arising from the same cause, is, that if a man is urged
to do anything like a tenth part of a day’s work, he will go away, and
steal sufficient to maintain him for some time; consequently, the
towns on the coast abound with thieves and vagabonds, who will not
work. Had domestic slavery (or rather I may call it service) been
tolerated, our merchants would have been encouraged to enter upon
other speculations, such as agriculture, and even trades; since many
of our merchants, who constantly employ five or six native and
European carpenters, would put their slaves to learn a trade,
whereas they have now no motive for doing so. Besides, the holders
of domestic slaves would use all their influence in abolishing the
removal of slaves into another country. In Elmina the Dutch settlers
still hold their domestic slaves, and they are in a thriving condition. In
its immediate neighbourhood I was surprised to find several fine
gardens and plantations, belonging to different merchants
established there. Moreover, the surrounding country is well cleared
of wood for a considerable distance, which renders that settlement
much more healthy than Cape Coast, or any of our English stations.
Although no man detests the Slave Trade more than myself, I cannot
help feeling convinced that much evil to the natives as well as to the
merchants has arisen from the abolition of domestic slavery in our
African settlements.
Another evil I also believe to be this. In all our Missionary Schools,
reading and writing, with a slight knowledge of arithmetic, is all that is
taught. By this, undoubtedly, much good is done; but much more
would be done, if these schools were also schools of industry. When
a boy has left school in this country, you never see him reading a
book, or even looking at a newspaper. All that these young men
aspire to, is to get something in the fashion of European clothing,
and to seek employment as clerks. I have already seen great
numbers, who have been dismissed from school, and can write a
little. They then consider themselves gentlemen, and their ideas are
above anything under a clerk’s place. Now, it is well known, that
among the few merchants established on the coast, employment as
clerks cannot be afforded to as many as are desirous of such a
situation.
I will, therefore, endeavour to point out a remedy for this evil,
which would, I think, not only benefit this class of individuals, but the
country at large, as well as our manufacturers in England:—I mean,
the establishment of schools of industry on a scale similar to that
which I have recommended for the garrison at Annamaboe. Let a
suitable piece of land be selected, which any one may have for
nothing; build upon it dwelling-houses and offices, as well as
workshops, which could soon be done in this country, if the people
could be induced to work. Men willing to become apprentices to
different trades should be selected, and bound to bricklayers,
carpenters, blacksmiths, shoemakers, weavers, wheelwrights, and
cabinet-makers, for three or five years, as might be deemed most
proper. These men might assist in building their dwellings and shops,
before they began to learn their trades, which some of them would
do by employment in this very work. Sufficient ground should also be
enclosed for raising such food as is necessary for the support of
these labourers.
Every article of subsistence is abundantly produced in this country,
and many luxuries, such as sugar and coffee. Vegetables, and great
quantities of fruit, grow spontaneously. Civilization might thus be
begun, but it could hardly be permanently advanced without a
recourse to arms. The Kings of Apollonia and Ashantee possess too
much arbitrary power to be withdrawn from their cruel and barbarous
habits by any other means than the sword; and it is said, that very
many other chiefs and kings are in the daily habit of making human
sacrifices.
Although Annamaboe has been already often described, a few
remarks upon it will not perhaps be unacceptable. Behind the fort, or
on its north side, is a piece of ground about two hundred yards
square, round which are built some very good houses, with their
stores, belonging to English and native merchants. These houses
and the mission-house are the only buildings worthy of notice,
except the King’s house. This is new, and copied from those of the
merchants; it is not, however, yet finished, and very probably never
will be, in consequence of the extreme indolence of the people. The
town may, perhaps, contain about three thousand inhabitants, and
consists (with the exception of the houses already mentioned) of
dwellings irregularly huddled together, generally built round a square
of about seven yards each way, with only one outer entrance, each
house opening into the square, and forming its sides. Some of the
principal houses of this description have benches running along the
outside wall inside of the square. These benches are made of fine
clay, in the form of sofas, and are handsomely coloured with clay of
a different colour. It is here that they hold their palavers, all being
seated around; the head man, or caboceer, is generally placed on a
seat raised above the rest.
Although the soil in the neighbourhood of Annamaboe is excellent,
yet it is very little cultivated; the natives chiefly depend upon the
people in the woods for their corn and yams, vegetables and fruit,
which are got in exchange for fish, a very plentiful article on the
coast at certain seasons of the year.
The only thing in the neighbourhood of Annamaboe worth
mentioning as a sign of either improvement or enterprise, is a good
road for about ten or twelve miles into the interior, made for the
purpose of conveying timber to the coast. This great undertaking
was executed entirely at the expense of one person, a very
intelligent and highly respectable native merchant, named Barns; but
since the abolition of domestic slavery, he, unfortunately, cannot
obtain labourers to carry on the timber-trade; though he has
procured from England timber-carriages and every thing requisite—
all is sacrificed. In fact, a complete check is now put upon every
effort of enterprise by the abolition of domestic slavery. These slaves
were much better provided for than our labourers in England, for
they had always plenty of food and clothing, and were never
exposed in bad weather, nor was one quarter of the labour ever
required from them that would be expected in England.
The natives of Annamaboe are in character much the same as
those at Cape Coast, and many of them are thieves and vagabonds.
During my short stay there my servant’s country cloth was stolen off
him in the night. When inquiry was made for it every one denied all
knowledge of the theft; however, on a closer search, the cloth was
found rolled up tightly under the head of one of the servants of the
house where I lodged. I had him well flogged; but nothing will cure
these people of thieving, except a tread-mill for they fear nothing so
much as labour.
During my stay at Annamaboe, the King sent me a pressing
invitation to pay him a visit, and in order to appear before his Majesty
in a suitable manner, I was advised by the merchants to send to
Cape Coast for my regimentals. On the following day I paid him a
visit in my uniform, with which he seemed much delighted. Having
previously learnt that I belonged to Her Majesty’s Life Guards, he
asked me a great many questions respecting the Queen of England
—how she was when I left England? and if Prince Albert was quite
well? how many children she had? how long she had been married?
and what were their titles? He laughed heartily when I informed him
that Her Majesty had five children in so short a time, and asked me
how I accounted for the English ladies being so prolific? Upon which
I told him that the reason was, that in England one man had only one
wife: he could not be persuaded, however, that one wife was
sufficient for one man.
I experienced great kindness during my stay at Annamaboe from
the merchants of that place, both English and native; and was
indebted, during the whole of my visit there, to the hospitality of Mr.
Brewe, a very respectable and enterprising merchant.
Among the native merchants I may justly point out Mr. Parker,
who, though educated in Africa, would appear with advantage even
in Europe. His memory is astonishing; he has read a great deal, and
has a very good library of the best English writers. With regard to
reading, indeed, he is an exception to the rest of his countrymen,
owing, I believe, principally to their erroneous system of education.
November 30th.—I took my departure from Annamaboe, to visit
the krooms[4] along the coast. Three quarters of a mile from
Annamaboe, we reached a small village of about four hundred
inhabitants, named Agah, and bearing E. 2° N. from Annamaboe. My
companion, Mr. Brewe, being well acquainted with the King, or chief,
I was introduced to him, and he expressed his gratification at seeing
me in his kroom, and desired us to enter his house, and partake of
some palm wine, or peto.[5] But having a long and difficult journey to
perform in the scorching sun, we excused ourselves, and proceeded
on our journey to the next kroom, which is three miles and a quarter
from Annamaboe. Our road was along the beach, on dry sand, ankle
deep, and in the sun, with a heat of 118° Fahrenheit, which rendered
it very fatiguing for people on foot. However, in an hour and a quarter
we reached the kroom called Little Cromantine, formerly a Dutch
settlement of considerable trade, bearing E. 2° N. from Annamaboe.
It has a strong fort, although now abandoned and going to decay;
consequently its trade has also gone to Annamaboe. The fort is in
one of the best positions on the whole of the African coast. It is built
on a perpendicular rock one hundred feet high, washed at its base
by the sea. It is so steep as to be accessible by land only by means
of a zigzag path, and yet its garrison surrendered without resistance
to the Ashantees, when they might have defended themselves
against any number of assailants. Its courtyard is entirely overgrown
with small shrubs; but there still remain on the batteries twenty-four
good twenty-four pounders.
This fort might be easily put into complete repair. The village
contains not more than five or six hundred inhabitants, who live
chiefly by catching fish, which they carry to Annamaboe. It is a
wretched kroom. The houses are very indifferently built, without any
regularity; and in passing from house to house, you must climb over
one rugged rock after another, as is sometimes the case on the sea-
beach in England.
After surveying the fort and village, we commenced our march
towards Cromantine, from which the last-named kroom derives its
name. It is two miles and a half distant, bearing by compass E. 1° N.
The road being very bad, we did not reach it until about ten o’clock.
The entrance to the town is very steep, as it is elevated one hundred
feet above Little Cromantine. Its situation is very grand and romantic.
On suddenly emerging from a very narrow path, about the width of a
sheep-track, and six feet deep, the town presents itself in full view on
the right front, and immediately on the right is a steep ravine, thickly
planted with the beautiful plantain and banana trees, the cool aspect
of which is refreshing to one half melted under a tropical sun; for,
unluckily, my means would not allow me to be carried in a hammock,
as my friend was. Thank God, however, my health was good, and I
bore the journey well. The town is much more regularly built, with a
more level foundation than Little Cromantine. We halted in the
market-place, in the centre of the town, where we were refreshed
with some ale furnished by my friend Mr. S. Brewe. During this time
the natives assembled around us in great numbers, gazing upon us
with astonishment. Mr. Brewe’s musical box pleased them very
much.
In the centre of the market-place is a very dirty, stagnant pool of
water, the exhalation from which was very unpleasant; and though a
drain about twenty yards long and three feet deep would have
completely removed it, the inhabitants are too lazy to make it. The
greater part of the Fantee people are the most ungenerous,
ungrateful, and unneighbourly people in the world; so much so, that
when their neighbour’s house is on fire, they will not assist in
extinguishing it, unless hired to do so. Although they are very
superstitious respecting their fetish or religious rites, they have no
prescribed form or system of performing them.
In Cromantine there exists a tradition, or rather a tale, to deceive
strangers, that they have still in their possession a male child, who
has existed ever since the beginning of the world. This child, they
declare, neither eats, drinks, nor partakes of any nourishment, yet
still continues in a state of childhood. When I laughed at this absurd
tale, it somewhat offended my friend Mr. Brewe, who declared that
he himself and his father had actually seen this infant. I therefore
expressed a wish to see this extraordinary child; and during the half
hour which was required to prepare him for the visit, we were
admitted into their fetish-house, or temple, in the corner of which was
seated in a chair a little clay figure of the god whom they invoke or
threaten, according to circumstances. In the same house, leaning
against the wall, was the hollow trunk of a cocoa-nut tree, chalked
over with white spots. This, they told us, was sent down to them from
heaven, and was preserved here as a proof that their fetish lives for
them. When I reproved their folly in believing such tales, they
seemed quite astonished and incensed, especially the old fetish-
woman, a priestess, who at times extorts great sums for the
preparation of certain charms, supposed to be very potent. When a
man is sick, his relations send for the fetish-man, who, if the party is
found to be very anxious respecting the sick man, generally makes a
heavy charge, in addition to a gallon of rum to drink success to the
fetish; and he very frequently orders a few bottles of rum to be buried
up to the neck in the ground in different places, which the god is
supposed to take as a fee for his favours to the sick man. If he
should die, the fetish-man assures his relatives that the favour of the
god was not to be gained by so small a quantity of rum. Such is the
abject superstition prevalent on this coast.
At length I became impatient to see this wonderful dwarf, or child
of other days, but was still desired to wait a little longer. However, as
we were anxious to proceed on our journey, we set off. Fortunately,
our road onwards passed close to the residence of this wonderful
child, so that we halted, in the hope of having a peep at him. Being
again delayed, I lost all patience, and resolved to enter his dwelling.
My African friends and the multitude assembled from all parts of the
town, warned me of the destruction that would certainly overtake me,
if I ventured to go in without leave. But I showed them my doubled
barrelled gun as my fetish, and forced my way through the crowd.
On entering through a very narrow door or gateway, into a circle of
about twenty yards diameter, fenced round by a close paling, and
covered outside with long grass, about nine feet high, (so that
nothing within could be seen,) the first and only thing I saw was an
old woman, whom, but for her size and sex, I should have taken for
the mysterious being, resident there from the time of the Creation.
She certainly was the most disgusting and loathsome being I ever
beheld. She had no covering on her person (like all the other natives
of this place), with the exception of a small piece of dirty cloth round
her loins. Her skin was deeply wrinkled and extremely dirty, with
scarcely any flesh on her bones. Her breasts hung half way down
her body, and she had all the appearance of extreme old age. This
ancient woman was the supposed nurse of the everlasting child. On
my entering the yard, this old fetish-woman (for such was her high
style and title) stepped before me, making the most hideous
gestures ever witnessed, and endeavouring to drive me out, that I
might be prevented from entering into the god’s house; but in spite of
all her movements I pushed her aside, and forced my way into the
house. Its outward appearance was that of a cone, or extinguisher,
standing in the centre of the enclosure. It was formed by long poles
placed triangularly, and thatched with long grass. Inside of it I found
a clay bench, in the form of a chair. Its tenant was absent, and the
old woman pretended that she had, by her magic, caused him to
disappear.
On my return, I found my friends anxiously waiting for me,
dreading lest something awful might have happened to me; and the
townspeople seemed quite in a fury. They did not, however, dare to
attack me, for they are great cowards when the lest determination or
spirit of resistance is shown. They are so superstitious, that not one
individual would venture over the threshold of the holy house,
without the permission of the old nurse. When I explained to the
multitude the nature of the trick practised by the old woman, they
were greatly incensed. There can be no doubt that some neighbour’s
child is borrowed whenever strangers wish to see this wonderful
infant; and when dressed up and disguised by various colours of
clay, it is exhibited as the divine and wonderful child. The natives are
so credulous, that a fetish-man or woman has no difficulty in making
them believe any thing, however extravagant.
After the delay occasioned by my visit, we went on to our next
stage, a small town near the beach, called in the native language,
Occro, which signifies salt-pond. It contains about two thousand
inhabitants, and derives its name from the lake on which different
parts of it stand. Its appearance is very picturesque, as it is shaded
by many large cotton and adoomah, as well as cocoa-nut trees,
which grow in abundance on this part of the coast.
Here the Wesleyan missionaries have an establishment, which we
visited. We remained there for some hours during the heat of the
day, which was excessive, making the loose sand very troublesome.
On our arrival, my friends (though they had been carried through the
whole distance) were glad to lie down to rest; but being myself
anxious to see and learn as much as possible, I went over the
greater part of the town to observe the manners and habits of the
people, which differ considerably from those of Cape Coast or
Annamaboe, although not at a great distance from them. The natives
of this place are more generous in their manner, and in many of their
features differ entirely from those of the Fantees, bearing much
resemblance in features and form of the head to the Arabs and
Fellátahs. Their limbs also are more elastic, and their eyes quicker
than those of the Fantees, who are the heaviest and most morose of
all the Africans whom I have seen.
The houses here are much cleaner and better constructed than at
Cape Coast or Annamaboe. They are generally built round a square
yard, with one main entrance into it. This is mostly about four yards
by twelve, the houses forming its sides, with entrances to the
different apartments from the court or yard outside of these rooms.
Along the walls are clay benches, in the form of sofas, which are
shaded from the sun by projecting roofs. In the morning, the master
of the house sits here with his attendants, and drinks palm-wine; but
the women are his principal drudges or slaves, as is the case in
almost all other parts of Africa. The master of the house has
generally from six to ten, or even twenty wives, according to his
means, and a proportionate number of slaves. The slaves are not
usually treated worse than his wives. Marriages are here made by
purchase, as in other parts of this coast. When a man sees a girl to
whom he takes a fancy, he goes to her father, and bargains for her
as he would for a sheep or goat, without any consideration of the
disparity of age, nor are the girl’s inclinations ever for a moment
thought of. Even the most influential of the native merchants, who
have had a liberal education, do the same thing, and maintain a vast
number of wives at an enormous expense.
On inquiry, I found that many Arabs and Moors, as well as
Fellátahs, had found their way to this place, either as slaves or
fugitives, from their own country, and thus the difference of feature
before noticed may be accounted for. Fishing is the chief occupation
of the inhabitants, who dry the fish which they catch in great
abundance, and carry them to Annamaboe and into the interior.
Palm-oil is also made here, as well as farther inland.
The lake from which the town derives its name is very salt,
although unconnected with the sea. A high bank of sand, about a
hundred yards broad, separates this lake from the sea; consequently
the salt water must filter through the sand into the lake, which, at
high water, is much lower than the sea. From the nature of the soil
and bed of the lake, there is very little doubt but that it was once an
inlet of the sea, now separated from it by sand and shells washed up
by the tremendous swell all along this coast;—hence the lagoons, or
salt lakes, found in many places, and which stretch out to a great
extent. The water is very bad, and can only be obtained by digging,
or rather scratching holes in the sand, and it is always brackish. This
town bears E. 1° N. from Annamaboe, and is distant about nine
miles from Cromantine. We experienced great kindness at this place
from the Missionary teacher, a native of Cape Coast, placed here by
Mr. Freeman.
FOOTNOTES:
[4] Villages.
[5] A beer made from Indian corn.
CHAPTER IV.
Strange Articles of Food—Native Cookery—The River
Amissa—Reception by the Caboceer of Amissa—Soil, Fruits,
&c.—An Adventure—Visit from a Hyena—The River Anaqua
—Arsafah—Soil, Fruits, &c.—Beautiful Birds—Moors and
Arabs here—Cattle—Return to Cape Coast—Hospitable
Reception there—Invitation from the King of Ashantee—My
Reply—Visit the Neighbourhood of Cape Coast—Coffee
Plantations—Indolence of the Natives—The Town of
Napoleon—Eyau Awkwano—Fruits Growing Spontaneously
—Bad Roads—Singular Mode of Carrying Timber—Cotton
Trees—The Dwarf Cotton Shrub—Scene of a Sanguinary
Battle—Djewkwa—Native Houses—An Intoxicated Caboceer
—The Caboceer’s Presents—Account of him—Return to
Cape Coast—Sail for Whydah—Winnebah Method of Curing
Fish—Natives—Stock—Neighbouring Country—The Devil’s
Hill—Soil—Yanwin (samphire)—The River Jensu—Beautiful
Birds—The King-fisher.
At 4 a.m. we resumed our journey to the River Amissa, distant
three miles. Our road passed over loose sand, and was very
fatiguing to the traveller. After walking about two miles, we came to a
small lake, where we found two fishermen busily engaged in cutting
up a very large shark, which they said they were dividing into so
many cowries’ worth, or, as we should say, two pennyworths. Here
“all is fish that comes to net.” They eat anything; alligators, alligators’
eggs, dogs, monkeys, cats,—in fact, there are few things they will
not devour as a meal. Their method of cooking is certainly very
good. Their soups and stews are wholesome; and their palm-soup is
delicious, either made with fish or fowl; it is seasoned with palm-oil
and pepper. Kankie, a sort of bread made from the Indian corn,
coarsely ground, is the most common food, as wheaten bread is in
Europe. Of vegetables they have great varieties: yams, cassada, or
manioc root, sweet potatoes, and plantains, as well as many other
herbs used for soups. We saw at this place the remains of a very
large whale, which had been driven on shore some time before.
After passing along the beach, still on the loose sand, about one
mile, we reached the river Amissa, which might more correctly be
called a lake. The whole of the party except myself were carried
across by the same men who had carried them the previous part of
the journey; but I, having no carriers, was ferried across by one of
the chief’s or caboceer’s canoes, which happened to be on the lake.
After crossing it, we immediately proceeded to the kroom, or village,
named, from the lake or river, Amissa. Here the old caboceer
received us very kindly, and soon cleared out a house for our
accommodation. We then walked round the village, which is
pleasantly situated on a good soil, differing from any I had seen on
the coast farther westward. It is black, loamy, and very rich and
fertile, bearing many large trees of different kinds, such as cocoas,
bananas, and plantains, in great abundance. Pine-apples come up
spontaneously.
After walking round the kroom, we went to the river to bathe, and
found that it had risen considerably since we crossed it, as the sea,
when near high water, flows into it. It has here, however, nearly
banked itself off. The water of this lake is very salt, although it is
constantly fed by a freshwater stream from the N.W. This river forms
a lagoon at a short distance from the sea, eastwards. On returning to
our lodgings, which had nothing but bare walls, we made a hearty
supper, sitting or lying on the ground or floor, and were afterwards
joined by the good old caboceer over a glass of grog, which he very
readily accepted, accompanied by some of his captains. Thus we
amused ourselves till twelve o’clock, when one of our party having
got a little too much, became rather quarrelsome, and by some
accident upset the candle, so that we were left in total darkness, for
as the hut had no windows, we were not benefited by the moonlight.
The old caboceer seemed much alarmed, and clasped me tightly
round the waist with both his arms for protection. A light was,
however, soon procured by help of a lucifer-match, and lo! all the old
chief’s captains had deserted him, supposing the light had been
purposely extinguished for some hostile design. The old man,
however, was soon convinced of the contrary, and I escorted him
home to his house, which differed from those already described only
by having the fire-place inside instead of outside of it. When I
returned all the party lay down to rest till the morning. I had borrowed
a grass mat from the caboceer, and the others lay in their baskets.
Musquitoes, however, were so numerous that we could get no rest;
at about half-past two A.M. my friend Mr. Brewe and his wife were
entirely driven out, and made an attempt to sleep in the street, but
found their tormentors still more numerous there; whereupon, they
resolved upon beating a retreat back to Annamaboe. However, as I
had already walked twelve miles in a scorching sun and over a
miserable road, I felt no inclination to accompany them, particularly
as we had not yet seen any thing of the neighbouring country.
Besides which, we had not finished our intended journey.
My remonstrances, however, were in vain. Mr. Brewe had
determined to return, and awoke my other friend, who was
comfortably reposing under the protecting influence of Bacchus. He
had felt nothing of the musquitoes, and very much wished to remain
till morning; but Mr. Brewe was not to be dissuaded, and accordingly
ordered his servants and baggage to get into marching order. I
determined, notwithstanding, to remain alone. Mr. Brewe showed
great anxiety for my safety, and very kindly left the provision-boxes
for my use during the next two days, which was very desirable, for
our money is of no value in this country, cowries being the only
currency known.
After the departure of my friends, I lay down outside of the hut,
and was just falling asleep, when I felt something touch my cap. I
was not alarmed, however, supposing it to be either a dog or a pig,
smelling at my head; but on moving my head, and making a noise to
drive away my unwelcome visitor, the animal made more noise in his
retreat than it seemed possible for a dog to make, and moved much
faster than a pig. This circumstance induced me to get up, when, to
my astonishment, the same animal having been obliged to repass
me, as it had been frustrated in its first attempt to escape by getting
bewildered amongst the houses, it turned out to be a large hyena, or,
as the natives call it, a patakoo. These beasts are so ravenous and
so numerous, that they frequently carry off cattle, pigs, poultry, and
even dig or scratch up dead bodies.
In the morning, when the old caboceer visited me, I informed him
of what had happened, and he congratulated me upon my escape,
as he assured me that those beasts frequently carry off a bullock or
a hog.
After breakfast the caboceer called again upon me, inviting me to
go to his house to be introduced to his family, and to drink with him.
He pressed me very much to remain with him a few days, but I
begged him to excuse me, promising to come another time and
remain there a short time. The village bears nearly the same
direction by the compass as the other two places already mentioned.
December 1st.—At 10 a.m. I set off on my journey to the river
Anaqua, only two miles distant. It is now the dry season and is very
small; it runs into the lagoon, which I was obliged to cross in my way
to the small village or kroom named Arsafah. This kroom is situated
between the lagoon and the sea, but close to the latter. Its natives
are maintained chiefly by fishing. But at a little distance in the interior
much corn is produced, and it is often brought to this place for
shipment, sometimes at the rate of sixpence per bushel.
The soil is much more fertile here than at Cape Coast. Cocoa-nuts
grow in great abundance, although near the sea no trees of any
considerable size are to be found. The ground is mostly covered with
shrubs and small trees, about ten or twelve feet high. At this place I
saw some very handsome birds, of beautiful plumage, such as the
splendid crown-bird. They are very wild; few of them, indeed, are
stationary in any part of this coast. They migrate every three months,
and some continue here only a few days, not remaining to breed,
perhaps as being too near the sea. The fish taken in this lagoon
have a much better flavour than those caught in the sea.
The inhabitants of this place are much like those of Accra; much
better made than the natives of Cape Coast, the form of their head
being much finer. I found, upon inquiry among some of the old
people, that they had come from a great distance in the interior, and

Das könnte Ihnen auch gefallen