Skip to content

stub classes to allow certain teensy code to be compiled and run on a desktop PC

License

Notifications You must be signed in to change notification settings

newdigate/teensy-x86-stubs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teensy x86 stubs

MIT license CMake CMake basic-test

stub classes implementing basic arduino/teensy functions for compiling and debuging on your x86/x64 architecture

eco-system

sd | audio | st7735 | midi | bounce2 | encoder

quick example

main.cpp

#include <Arduino.h>
IntervalTimer myTimer;

void blinkLED() {
    Serial.printf("BLINK %d\n", 1000);
}

int main(int argc, char **argv){
    initialize_mock_arduino();

    myTimer.begin(blinkLED, 250000);
    delay(1000000);
}

CMakelists.txt reference

project(thing C CXX)
include(cmake_declare_and_fetch.cmake.in)
DeclareAndFetch(teensy_x86_stubs https://github.com/newdigate/teensy-x86-stubs.git main src)
add_executable(thing main.cpp)
target_link_libraries(thing teensy_x86_stubs)

build instructions:

git clone https://github.com/newdigate/teensy-x86-stubs.git
cd teensy-x86-stubs
mkdir cmake-build-debug
cd cmake-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .

timing emlation

  • to initialize the arduino timing library so that millis() will return the duration in milliseconds since the test app has been runnning
    initialize_mock_arduino()

credits

license

Unless specified in source code file, all code is MIT license.

About

stub classes to allow certain teensy code to be compiled and run on a desktop PC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published