mirror of
https://github.com/newdigate/teensy-x86-stubs.git
synced 2026-07-04 14:46:42 +00:00
add a blink stetch!
This commit is contained in:
+2
-1
@@ -31,4 +31,5 @@
|
||||
*.out
|
||||
*.app
|
||||
|
||||
cmake-build-debug
|
||||
cmake-build-debug*
|
||||
.idea
|
||||
|
||||
@@ -45,6 +45,7 @@ set(HEADER_FILES
|
||||
|
||||
add_library(teensy_x86_stubs SHARED STATIC ${HEADER_FILES} ${SOURCE_FILES})
|
||||
add_subdirectory(test/first)
|
||||
add_subdirectory(test/blink)
|
||||
|
||||
set_target_properties(teensy_x86_stubs PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(blink_test C CXX)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
add_executable(blink
|
||||
../../src/Arduino.h
|
||||
../../src/Arduino.cpp
|
||||
../../src/hardware_serial.h
|
||||
../../src/hardware_serial.cpp
|
||||
../../src/core_pins.h
|
||||
../../src/core_pins.cpp
|
||||
../../src/Stream.cpp
|
||||
../../src/Stream.h
|
||||
../../src/WString.cpp
|
||||
../../src/WString.h
|
||||
../../src/Print.cpp
|
||||
../../src/Print.h
|
||||
../../src/Printable.h
|
||||
../../src/pins_arduino.h
|
||||
../../src/IntervalTimer.cpp
|
||||
blink.cpp
|
||||
)
|
||||
#set(CMAKE_VERBOSE_MAKEFILE 1)
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "../../src/Arduino.h"
|
||||
#include "../../src/IntervalTimer.h"
|
||||
//#include <Arduino.h>
|
||||
IntervalTimer myTimer;
|
||||
|
||||
void blinkLED() {
|
||||
Serial.printf("BLINK\n");
|
||||
}
|
||||
|
||||
int main() {
|
||||
initialize_mock_arduino();
|
||||
|
||||
myTimer.begin(blinkLED, 250000); // blinkLED to run every 0.15 seconds
|
||||
delay(100);
|
||||
char s[10] = "123123\0";
|
||||
Serial.printf("Hello %s\n", s);
|
||||
|
||||
int m = millis();
|
||||
Serial.printf("Please type a sentance.... %d\n", m);
|
||||
|
||||
String s2 = Serial.readStringUntil('\n');
|
||||
Serial.printf("Thank you for your response '%s' \n", s2.c_str());
|
||||
|
||||
delay(1000000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user