Created
October 4, 2019 14:58
-
-
Save Inkering/c07007ea90642a7e1754ec8341e044b3 to your computer and use it in GitHub Desktop.
Revisions
-
Inkering created this gist
Oct 4, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ struct Speeds { // struct int left; int right; }; Speeds new_speed; Speeds last_speed; Speeds PID(int leftSensor, int rightSensor) { // create a new set of speeds Speeds motorSpeeds; // default speed motorSpeeds.left = 80; motorSpeeds.right = 80; // pid loop here! // return the calculated speeds return motorSpeeds; } // the setup function runs once when you press reset or power the board void setup() { } // the loop function runs over and over again forever void loop() { new_speed = PID(1,2); }