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

Count from -200 to 200 with a 20 millisecond delay between each number

cmake_minimum_required(VERSION 3.12)
find_package(PropWare REQUIRED)
project(MAX72xx_Demo)
create_simple_executable(${PROJECT_NAME} MAX72xx_Demo.cpp)
int main () {
SPI::get_instance().set_mosi(Port::P2);
SPI::get_instance().set_sclk(Port::P0);
const MAX72xx leds(Port::P4);
leds.start();
for (int i = -200; i <= 200; ++i) {
leds.put_int(i, MAX72xx::BcdCharacter::ZERO, 4);
waitcnt(20 * MILLISECOND + CNT);
}
return 0;
}
PropWare::MAX72xx
Serially interfaced, 8-Digit LED display driver.
Definition: max72xx.h:59
PropWare::SPI
SPI serial communications library; Core functionality comes from a dedicated assembly cog.
Definition: spi.h:43
max72xx.h
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
leds
void leds(int bits)
Sets the on/off states of the 6 blue LEDs with a number that contains six binary 1/0 digits....
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
PropWare
Generic definitions and functions for the Parallax Propeller.
Definition: runnable.h:33