Added previous arduino implementations.
This commit is contained in:
24
EulerProject.ino
Normal file
24
EulerProject.ino
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "Timer.h"
|
||||
|
||||
#include "ProblemBase.hpp"
|
||||
#include "Problem3.hpp"
|
||||
|
||||
Problem3 problem = Problem3();
|
||||
Timer timer(MICROS);
|
||||
// Initialize serial connection
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
Serial.println("Start calculating...");
|
||||
timer.start(); // start the timer
|
||||
}
|
||||
|
||||
// Calculation loop
|
||||
void loop() {
|
||||
if (problem.Step()) {
|
||||
// Print solution
|
||||
Serial.println("Result = " + String(problem.output) + " in " + String(timer.read()) + "us");
|
||||
timer.stop();
|
||||
delay(100);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user