Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/********* Pleasedontcode.com ********** Pleasedontcode thanks you for automatic code generation! Enjoy your code! - Terms and Conditions: You have a non-exclusive, revocable, worldwide, royalty-free license for personal and commercial use. Attribution is optional; modifications are allowed, but you're responsible for code maintenance. We're not liable for any loss or damage. For full terms, please visit pleasedontcode.com/termsandconditions. - Project: Motor Control - Source Code compiled for: Arduino Mega - Source Code created on: 2024-01-16 09:45:37 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* move 18 motor in which 6 in left and 6 in right */ /* and 6 in front and back */ /****** END SYSTEM REQUIREMENTS *****/ /****** DEFINITION OF LIBRARIES *****/ #include
#include
/****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* move 18 motor in which 6 in left and 6 in right */ /* and 6 in front and back */ /****** FUNCTION PROTOTYPES *****/ void setup(); void loop(); /***** DEFINITION OF DIGITAL INPUT PINS *****/ const uint8_t leftMotorPins[6] = {3, 4, 5, 6, 7, 8}; const uint8_t rightMotorPins[6] = {9, 10, 11, 12, 13, 14}; const uint8_t frontMotorPins[6] = {15, 16, 17, 18, 19, 20}; const uint8_t backMotorPins[6] = {21, 22, 23, 24, 25, 26}; /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/ EasyButton button(leftMotorPins[0]); void setup() { // put your setup code here, to run once: for (int i = 0; i < 6; i++) { pinMode(leftMotorPins[i], OUTPUT); pinMode(rightMotorPins[i], OUTPUT); pinMode(frontMotorPins[i], OUTPUT); pinMode(backMotorPins[i], OUTPUT); } button.begin(); } void loop() { // put your main code here, to run repeatedly: if (button.read()) { // Move motors in the desired direction for (int i = 0; i < 6; i++) { digitalWrite(leftMotorPins[i], HIGH); digitalWrite(rightMotorPins[i], HIGH); digitalWrite(frontMotorPins[i], HIGH); digitalWrite(backMotorPins[i], HIGH); } delay(1000); // Adjust the delay as needed // Stop the motors for (int i = 0; i < 6; i++) { digitalWrite(leftMotorPins[i], LOW); digitalWrite(rightMotorPins[i], LOW); digitalWrite(frontMotorPins[i], LOW); digitalWrite(backMotorPins[i], LOW); } delay(1000); // Adjust the delay as needed } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)