diff --git a/exampleCode/platform.io-example/MyFancyATmegaProject/.gitignore b/exampleCode/platform.io-example/MyFancyATmegaProject/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/exampleCode/platform.io-example/MyFancyATmegaProject/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/exampleCode/platform.io-example/MyFancyATmegaProject/platformio.ini b/exampleCode/platform.io-example/MyFancyATmegaProject/platformio.ini new file mode 100644 index 0000000..17fabc2 --- /dev/null +++ b/exampleCode/platform.io-example/MyFancyATmegaProject/platformio.ini @@ -0,0 +1,16 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:uno] +platform = atmelavr +board = uno +framework = arduino + +debug_tool = simavr \ No newline at end of file diff --git a/exampleCode/platform.io-example/MyFancyATmegaProject/src/main.cpp b/exampleCode/platform.io-example/MyFancyATmegaProject/src/main.cpp new file mode 100644 index 0000000..ab01287 --- /dev/null +++ b/exampleCode/platform.io-example/MyFancyATmegaProject/src/main.cpp @@ -0,0 +1,44 @@ +#include +#include // intxx_t und uintxx_t als Datentypen + +int main(void) +{ + uint16_t result = 0; + + // enable ADC + ADCSRA |= (1 << ADEN); + // Setting the voltage reference to Arduino Input Power + ADMUX |= (1<