Initial commit
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Data Logger module helps you in storing data in form of .csv file.
|
||||
Later you can open this file to view your stored data.
|
||||
|
||||
You can reduce the size of library compiled by enabling only those modules that you want to
|
||||
use.For this first define CUSTOM_SETTINGS followed by defining INCLUDE_modulename.
|
||||
|
||||
Explore more on: https://thestempedia.com/docs/dabble/
|
||||
*/
|
||||
#define CUSTOM_SETTINGS
|
||||
#define INCLUDE_SENSOR_MODULE
|
||||
#define INCLUDE_DATALOGGER_MODULE
|
||||
#include <DabbleESP32.h>
|
||||
bool isFileOpen = true;
|
||||
uint8_t closeFileSignalPin = 2; //this pin is internally pulled up and a push button grounded on one side is connected to pin so that pin detects low logic when push button is pressed.
|
||||
|
||||
void initializeFile(){
|
||||
Serial.println("Initialize");
|
||||
DataLogger.createFile("Microphone");
|
||||
DataLogger.createColumn("Decibel");
|
||||
}
|
||||
|
||||
void setup() {
|
||||
pinMode(closeFileSignalPin,INPUT_PULLUP);
|
||||
Serial.begin(115200); // make sure your Serial Monitor is also set at this baud rate.
|
||||
Dabble.begin("Myesp32"); //set bluetooth name of your device
|
||||
DataLogger.sendSettings(&initializeFile);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Dabble.processInput(); //this function is used to refresh data obtained from smartphone.Hence calling this function is mandatory in order to get data properly from your mobile.
|
||||
if( isFileOpen == true)
|
||||
{
|
||||
print_Sound_data();
|
||||
DataLogger.send("Decibel",Sensor.getdata_Sound());
|
||||
}
|
||||
if((digitalRead(closeFileSignalPin) == LOW) && isFileOpen == true)
|
||||
{
|
||||
isFileOpen = false;
|
||||
DataLogger.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void print_Sound_data()
|
||||
{
|
||||
Serial.print("SOUND: ");
|
||||
Serial.println(Sensor.getdata_Sound(), 3);
|
||||
Serial.println();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Notification module can be used for notifying your mobile about status of various activities happening on your hardware.
|
||||
In this example a push button is connected to a digital pin. And mobile is notified about how many times that push button
|
||||
is pressed.
|
||||
|
||||
You can reduce the size of library compiled by enabling only those modules that you want to
|
||||
use. For this first define CUSTOM_SETTINGS followed by defining INCLUDE_modulename.
|
||||
|
||||
Explore more on: https://thestempedia.com/docs/dabble/
|
||||
*/
|
||||
|
||||
#define CUSTOM_SETTINGS
|
||||
#define INCLUDE_NOTIFICATION_MODULE
|
||||
#include <DabbleESP32.h>
|
||||
uint8_t pushButtonPin = 2;
|
||||
int counts = 0;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Dabble.begin("MyEsp32"); //set bluetooth name of your device
|
||||
pinMode(pushButtonPin, INPUT_PULLUP); //Since pin is internally pulled up hence connect one side of push button to ground so whenever button is pushed pin reads LOW logic.
|
||||
Dabble.waitForAppConnection(); //waiting for App to connect
|
||||
Notification.clear(); //clear previous notifictions
|
||||
Notification.setTitle("Button Counts"); //Enter title of your notification
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Dabble.processInput(); //this function is used to refresh data obtained from smartphone.Hence calling this function is mandatory in order to get data properly from your mobile.
|
||||
if (digitalRead(pushButtonPin) == LOW)
|
||||
{
|
||||
counts++;
|
||||
delay(1000); //debounce delay
|
||||
}
|
||||
Notification.notifyPhone(String("Button has been pressed ") + counts + String (" time"));
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
SMS module uses your smartphone to send SMS based on events occuring in your hardware board.
|
||||
|
||||
You can reduce the size of library compiled by enabling only those modules that you want to
|
||||
use. For this first define CUSTOM_SETTINGS followed by defining INCLUDE_modulename.
|
||||
|
||||
Explore more on: https://thestempedia.com/docs/dabble/
|
||||
*/
|
||||
|
||||
#define CUSTOM_SETTINGS
|
||||
#define INCLUDE_SMS_MODULE
|
||||
#include <DabbleESP32.h>
|
||||
uint8_t pushButtonPin = 2;
|
||||
|
||||
void setup() {
|
||||
Dabble.begin("MyEsp32"); //set bluetooth name of your device
|
||||
pinMode(pushButtonPin, INPUT_PULLUP); //Since pin is internally pulled up hence connect one side of push button to ground so whenever button is pushed pin reads LOW logic.
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Dabble.processInput(); //this function is used to refresh data obtained from smartphone.Hence calling this function is mandatory in order to get data properly from your mobile.
|
||||
if(digitalRead(pushButtonPin) == LOW)
|
||||
{
|
||||
SMS.sendMessage("0123456789","Buenas Noches"); //Contact Number, message content
|
||||
delay(1000); //debounce delay
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user