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: "Motorized Sensor" - Source Code compiled for: Arduino Uno - Source Code created on: 2024-01-11 13:43:28 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* motor driver */ /****** SYSTEM REQUIREMENT 2 *****/ /* motor driver */ /****** END SYSTEM REQUIREMENTS *****/ /****** DEFINITION OF LIBRARIES *****/ #include
#include
/****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* motor driver */ // Define any motor driver libraries or functions here /****** SYSTEM REQUIREMENT 2 *****/ /* motor driver */ // Define any motor driver libraries or functions here /****** FUNCTION PROTOTYPES *****/ void setup(void); void loop(void); /***** DEFINITION OF DIGITAL INPUT PINS *****/ const uint8_t HC_SR04_ECHO_PIN = 3; /***** DEFINITION OF DIGITAL OUTPUT PINS *****/ const uint8_t HC_SR04_TRIGGER_PIN = 2; /****** DEFINITION OF LIBRARY CLASS INSTANCES *****/ Ultrasonic ultrasonic(HC_SR04_TRIGGER_PIN, HC_SR04_ECHO_PIN); void setup(void) { // Motor driver setup code here // Ultrasonic sensor setup code here pinMode(HC_SR04_ECHO_PIN, INPUT); pinMode(HC_SR04_TRIGGER_PIN, OUTPUT); Serial.begin(9600); } void loop(void) { // Motor driver loop code here // Ultrasonic sensor loop code here Serial.print("Distance in CM: "); Serial.println(ultrasonic.read()); delay(1000); }
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)