PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Blinky_Demo.cpp

Basic usage of the PropWare::Pin class to blink an LED four times a second

cmake_minimum_required(VERSION 3.12)
find_package(PropWare REQUIRED)
project(Blinky_Demo)
create_simple_executable(${PROJECT_NAME} ${PROJECT_NAME})
int main () {
// Use the hardware counter module to blink an LED at 4Hz
const Pin led1(Port::P17, Pin::Dir::OUT);
// Notice that this method is non-blocking, because the Propeller's built-in hardware counter does all the hard work
led1.start_hardware_pwm(4);
// We'll toggle this LED in software. This is also know as "bit banging"
const Pin led2(Port::P16, Pin::Dir::OUT);
while (1) {
led2.toggle();
}
}
PropWare::Pin
Utility class to handle general purpose I/O pins.
Definition: pin.h:36
PropWare::Port
Flexible port that can have any pin enabled or disabled. Pins are independent of each other.
Definition: port.h:38
main
int main(void)
Definition: GraphicsTest.c:20
PropWare.h
CLKFREQ
#define CLKFREQ
Returns the current clock frequency.
Definition: propeller.h:46
waitcnt
#define waitcnt(a)
Wait until system counter reaches a value.
Definition: propeller.h:176
CNT
#define CNT
The system clock count.
Definition: propeller1.h:151
pin.h
PropWare
Generic definitions and functions for the Parallax Propeller.
Definition: runnable.h:33