CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 05:15:01 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=e4fa49059ac0dcf860ed21a1920e286ca9151ab20a2fa9b1968a68130cd1f494a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22In_RDoQA105ydEQSfK0OoeUagNLOA7ed%22%3B%7D; HttpOnly; Path=/
cf-ray: 98d41df2b9627679-BLR
Relay Controller rev_03 - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* 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: Relay Controller
- - Source Code NOT compiled for: Arduino Nano ESP32
- - Source Code created on: 2025-08-13 12:40:49
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* esp32 with i2c display,one relay out,one swich for */
- /* start, one swich for stop, one swich for time */
- /* setting up,one swich for time setting down,one */
- /* ds18b20 temperature sensor. */
- /****** END SYSTEM REQUIREMENTS *****/
- /********* User code review feedback **********
- #### Feedback 1 ####
- - not working
- #### Feedback 2 ####
- - no oled in my scope
- ********* User code review feedback **********/
- /* START CODE */
- /****** DEFINITION OF LIBRARIES *****/
- #include <Wire.h>
- #include <OneWire.h>
- #include <DallasTemperature.h>
- // Define pins for switches
- const int startSwitchPin = 2; // Start button
- const int stopSwitchPin = 3; // Stop button
- const int timeUpSwitchPin = 4; // Time setting up
- const int timeDownSwitchPin = 5; // Time setting down
- // Define pin for relay
- const int relayPin = 6;
- // Define pin for DS18B20 temperature sensor
- const int oneWireBusPin = 7;
- // Create OneWire and DallasTemperature objects
- OneWire oneWire(oneWireBusPin);
- DallasTemperature sensors(&oneWire);
- // Variables for system state
- bool systemRunning = false;
- int temperature = 0;
- int setTimeMinutes = 0;
- void setup() {
- // Initialize serial communication
- Serial.begin(115200);
- // Initialize pins
- pinMode(startSwitchPin, INPUT_PULLUP);
- pinMode(stopSwitchPin, INPUT_PULLUP);
- pinMode(timeUpSwitchPin, INPUT_PULLUP);
- pinMode(timeDownSwitchPin, INPUT_PULLUP);
- pinMode(relayPin, OUTPUT);
- // Initialize relay
- digitalWrite(relayPin, LOW); // Relay off
- // Initialize temperature sensor
- sensors.begin();
- // Initial status message
- Serial.println("System initialized");
- }
- void loop() {
- handleSwitches();
- readTemperature();
- // Optional: Send status over serial for debugging
- Serial.print("Temperature: ");
- Serial.print(temperature);
- Serial.print(" C, Set Time: ");
- Serial.print(setTimeMinutes);
- Serial.print(" min, Status: ");
- Serial.println(systemRunning ? "RUNNING" : "STOPPED");
- delay(200); // Loop delay
- }
- void handleSwitches() {
- // Read switch states
- bool startState = digitalRead(startSwitchPin) == LOW;
- bool stopState = digitalRead(stopSwitchPin) == LOW;
- bool timeUpState = digitalRead(timeUpSwitchPin) == LOW;
- bool timeDownState = digitalRead(timeDownSwitchPin) == LOW;
- if (startState) {
- systemRunning = true;
- digitalWrite(relayPin, HIGH); // Turn relay on
- }
- if (stopState) {
- systemRunning = false;
- digitalWrite(relayPin, LOW); // Turn relay off
- }
- if (timeUpState) {
- setTimeMinutes++;
- }
- if (timeDownState) {
- if (setTimeMinutes > 0) {
- setTimeMinutes--;
- }
- }
- }
- void readTemperature() {
- sensors.requestTemperatures();
- temperature = sensors.getTempCByIndex(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
-
π Exchange profit method
JavaScript | 3 sec ago | 0.24 KB
-
π Swapzone +37% glitch
JavaScript | 15 sec ago | 0.24 KB
-
π΅ Make 3000$ in 20 minutes π΅
JavaScript | 25 sec ago | 0.24 KB
-
π Instant BTC Profit Method β
Working
JavaScript | 44 sec ago | 0.24 KB
-
π Crypto Swap Glitch β
Working
JavaScript | 54 sec ago | 0.24 KB
-
π ChangeNOW Exploit
JavaScript | 1 min ago | 0.24 KB
-
β
Make $2500 in 20 minutesβββ H
JavaScript | 1 min ago | 0.25 KB
-
π Swapzone +37% glitch β 5
JavaScript | 1 min ago | 0.25 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand