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: "Pin Setup" - Source Code compiled for: ESP32 DevKit V1 - Source Code created on: 2024-02-01 13:31:49 ********* Pleasedontcode.com **********/ /****** SYSTEM REQUIREMENTS *****/ /****** SYSTEM REQUIREMENT 1 *****/ /* turn on DO0 when DI0 as true, turn on DO1 when DI1 */ /* as true */ /****** END SYSTEM REQUIREMENTS *****/ /****** DEFINITION OF LIBRARIES *****/ #include
//https://github.com/adafruit/Adafruit_MAX31865 /****** FUNCTION PROTOTYPES *****/ void setup(void); void loop(void); void updateOutputs(void); /***** DEFINITION OF DIGITAL INPUT PINS *****/ const uint8_t DI0_PushButton_PIN_D14 = 14; const uint8_t DI1_PushButton_PIN_D16 = 16; /***** DEFINITION OF ANALOG INPUT PINS *****/ const uint8_t AI0_Potentiometer_Vout_PIN_D4 = 4; /***** DEFINITION OF DIGITAL OUTPUT PINS *****/ const uint8_t DO0_LED_PIN_D17 = 17; const uint8_t DO1_LED_PIN_D18 = 18; /***** DEFINITION OF OUTPUT RAW VARIABLES *****/ /***** used to store raw data *****/ bool DO0_LED_PIN_D17_rawData = 0; bool DO1_LED_PIN_D18_rawData = 0; /***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/ /***** used to store data after characteristic curve transformation *****/ float DO0_LED_PIN_D17_phyData = 0.0; float DO1_LED_PIN_D18_phyData = 0.0; /****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/ Adafruit_MAX31865 max31865_sensor(10, 11, 12, 13); // Create instance of Adafruit_MAX31865 class void setup(void) { // put your setup code here, to run once: pinMode(DI0_PushButton_PIN_D14, INPUT_PULLUP); pinMode(DI1_PushButton_PIN_D16, INPUT_PULLUP); pinMode(AI0_Potentiometer_Vout_PIN_D4, INPUT); pinMode(DO0_LED_PIN_D17, OUTPUT); pinMode(DO1_LED_PIN_D18, OUTPUT); // Initialize the MAX31865 sensor max31865_sensor.begin(MAX31865_3WIRE); // Initialize the sensor with 3-wire configuration } void loop(void) { // put your main code here, to run repeatedly: bool DI0_Status = digitalRead(DI0_PushButton_PIN_D14); // Read the status of DI0 bool DI1_Status = digitalRead(DI1_PushButton_PIN_D16); // Read the status of DI1 // Update output raw data based on input status DO0_LED_PIN_D17_rawData = DI0_Status; DO1_LED_PIN_D18_rawData = DI1_Status; updateOutputs(); // Refresh output data } void updateOutputs() { digitalWrite(DO0_LED_PIN_D17, DO0_LED_PIN_D17_rawData); digitalWrite(DO1_LED_PIN_D18, DO1_LED_PIN_D18_rawData); }
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)