Difference between revisions of "A Tarduino example done properly"

From The TinkerNet Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
= main.cpp =
 
= main.cpp =
  
  #include <Arduino.h>
+
  #include <Arduino.h> // Pretty much only here to giv us Serial Communications & delay()
 
   
 
   
 
  #include "FooBar.h"
 
  #include "FooBar.h"
Line 9: Line 9:
 
   Serial.begin(115200);
 
   Serial.begin(115200);
 
   Serial.println("Howdee!");
 
   Serial.println("Howdee!");
   delay(10000);
+
   delay(10000);   // What a silly way to rape a microcontroller...
 
  }
 
  }
 
   
 
   

Revision as of 00:28, 8 December 2020

main.cpp

#include <Arduino.h>  // Pretty much only here to giv us Serial Communications & delay()

#include "FooBar.h"

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Howdee!");
  delay(10000);   // What a silly way to rape a microcontroller...
}

void loop() {
  // put your main code here, to run repeatedly:
  Function1();
}

FooBar.h

void Function1();

Function1.cpp

#include <Arduino.h>

void Function1()
{
    Serial.println("Hi Grant!");
}