Posts

Showing posts with the label Code

Make Your Own Arduino Library

Image
Arduino is pretty heavily based on C++ (a computer programming language). This language relies upon things called headers, functions,and libraries. These things actually carry over to Arduino too - libraries are included at the top of your code and are used in order to simplify your project code: #include <LiquidCrystal.h> #include <Servo.h> In this project I will demonstrate how to make your own Library. Step 1: Software There is plenty of specialized software you can use for this, but your basic text editor like Notepad should work. *You could also try something like Notepad++ or VSCode Step 2: Arduino Code This is a basic Blink sketch to toggle the on-board LED: void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); } This code isn't very complicated, and it generally wouldn't need a library. However, for the sake of demonstration, we will make one anyway. ...