Skip to content

Instantly share code, notes, and snippets.

View Mayoogh's full-sized avatar
:octocat:
Focusing

Mayoogh Girish Mayoogh

:octocat:
Focusing
View GitHub Profile
@Mayoogh
Mayoogh / DebugSerial.ino
Created August 2, 2024 09:42
Debug Serial
#define DEBUG 1 // Set to 0 to disable debugging, 1 to enable
#if DEBUG
#define DEBUG_PRINT(x) Serial.print(x)
#define DEBUG_PRINTLN(x) Serial.println(x)
#else
#define DEBUG_PRINT(x)
#define DEBUG_PRINTLN(x)
#endif
#include <WiFi.h>
#include <PubSubClient.h>
/* reference https://youtu.be/5tG3JXFYrUo von Ali Panjaitan
*/
const char* ssid="SSID";
const char* pass="password";
const char* brokerUser = "user";
const char* brokerPass = "password";
const char* broker = "mqtt.dioty.co";
//#define DEBUG_SERIAL // Uncomment for Serial Monitor
#ifdef DEBUG_SERIAL
#define DEBUG_SERIAL_BEGIN(x) Serial.begin(x)
#define DEBUG_SERIAL_PRINT(x) Serial.print(x)
#define DEBUG_SERIAL_PRINTLN(x) Serial.println(x)
#else
#define DEBUG_SERIAL_BEGIN(x)
#define DEBUG_SERIAL_PRINT(x)
#define DEBUG_SERIAL_PRINTLN(x)
#endif
/*
DIY Simple Arduino Bluetooth Controlled Robot Car
Coder - Mayoogh Girish
Website - http://mgprojecthub.com/
Download the App :
*/
char data = 0; //Variable for storing data
int RMA = 8;