Hi guys im trying to do a little project and i can't work out the best way to condense the following code down using functions. I just need to make it more streamlined.
T.I.A
#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); #include <Servo.h>
Servo inservo;
Servo outservo;
int inpir;
int outpir;
int c = 0;
void setup()
Hello
Yes you can.
Build some objects and methods to streamline the code.
Drop all information for the servos and LCD in datablocks using the struct instruction. A method for the servos and one method for the LCD will operate the information out of the a.m. datablocks. Maybe a timer handler is needed too.
Have a nice day and enjoy coding in C++.
Hello siu3
It is recommented to take a view into some powerful C++ instructions like STRUCT, ENUM, ARRAY, CASE/SWITCH,UDT, RANGE-BASED-FOR-LOOP, etc.
Have a nice day and enjoy coding in C++.