Learn PropWare
Install the PropWare Software
Download and run the installer for Windows or Linux.
Say Hello
- Note
- The content for this example can also be found in the installation directory under
Examples/GettingStarted
and on this website here.
-
The command prompt is the fastest way to get up and running and requires the fewest dependencies. If you prefer to use an integrated development environment (IDE) or graphical user interface (GUI), see Using an IDE.
- Create a folder named
GettingStarted
which will hold your project files, such C:\Users\David\Documents\Propeller\GettingStarted
. Create two files in the directory, the first named CMakeLists.txt
and the second named GettingStarted.cpp
. Into the first, copy the following configuration file: cmake_minimum_required(VERSION 3.3)
project(GettingStarted)
create_simple_executable(${PROJECT_NAME} GettingStarted.cpp)
and into the second, copy the following source code: pwOut <<
"Hello, world!";
return 0;
}
- Open a command prompt (type
cmd
into the Start Menu) and run these commands 1 > cd C:\Users\David\Documents\Propeller\GettingStarted
This will create a new folder named bin
in your project.
- Connect your Propeller and run the following two commands. If it is the first time you have connected the Propller to your computer, wait for any dialogue boxes to finish installing drivers.
1 > cmake -G "Unix Makefiles" ..
This will compile your project, download it to the Propeller, and open a terminal for you to see the program output.
Starting a New Project
- The defining piece of a PropWare project is the
CMakeLists.txt
file. It must be named "CMakeLists.txt" as per CMake standards. Full details on CMake files in relation to PropWare are documented under Build System, but a typical use case with four source code files is provided below. 1 cmake_minimum_required (VERSION 3.3)
2 find_package(PropWare REQUIRED)
4 project(Quadcopter C CXX ASM ECOGC)
6 create_simple_executable(${PROJECT_NAME}
- Write your source code.
- At the terminal, enter your project's directory. Type
cmake -G "Unix Makefiles" .
. This will generate a Makefile for you.
- Last step: choose between
make
, make debug
and make run
.
make
: Without any arguments, make
will simply compile your executable - in this case, HelloWorld.elf
.
make debug
: The debug
target will load your program into RAM and then start a terminal to monitor and/or communicate with the Propeller.
- Your keyboard's arrow keys are the best way to exit the terminal - press any of them once. Do not use Control-C.
make run
: The run
target will load your program to EEPROM and return to command prompt.