Skip to content

Commit

Permalink
Added Duplicate Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mimansamaheshwari committed Sep 13, 2019
1 parent bf5102e commit a914cc6
Show file tree
Hide file tree
Showing 38 changed files with 389 additions and 67 deletions.
4 changes: 2 additions & 2 deletions examples/01. evive/03.Gamepad/03.Gamepad.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ void loop() {
Serial.print("Radius: ");
Serial.print(b);
Serial.print('\t');
float c = GamePad.getx_axis();
float c = GamePad.getXaxisData();
Serial.print("x_axis: ");
Serial.print(c);
Serial.print('\t');
float d = GamePad.gety_axis();
float d = GamePad.getYaxisData();
Serial.print("y_axis: ");
Serial.println(d);
Serial.println();
Expand Down
12 changes: 6 additions & 6 deletions examples/01. evive/06.Inputs/06.Inputs.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ 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.

Serial.print("Pot1:");
Serial.print(Inputs.getvalue_Pot1());
Serial.print(Inputs.getPot1Value());
Serial.print('\t');
Serial.print("Pot2:");
Serial.print(Inputs.getvalue_Pot2());
Serial.print(Inputs.getPot2Value());
Serial.print('\t');
Serial.print("SS1:");
Serial.print(Inputs.getStatus_SlideSwitch1());
Serial.print(Inputs.getSlideSwitch1Value());
Serial.print('\t');
Serial.print("SS2:");
Serial.print(Inputs.getStatus_SlideSwitch2());
Serial.print(Inputs.getSlideSwitch2Value());
Serial.print('\t');
Serial.print("TS1:");
Serial.print(Inputs.getStatus_TactileSwitch1());
Serial.print(Inputs.getTactileSwitch1Value());
Serial.print('\t');
Serial.print("TS2:");
Serial.print(Inputs.getStatus_TactileSwitch2());
Serial.print(Inputs.getTactileSwitch2Value());
Serial.println();
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ void loop() {
void print_Accelerometer_data()
{
Serial.print("X_axis: ");
Serial.print(Sensor.getdata_Accelerometer_xaxis(), 4);
Serial.print(Sensor.getAccelerometerXaxis(), 4);
Serial.print('\t');
Serial.print("Y_axis: ");
Serial.print(Sensor.getdata_Accelerometer_yaxis(), 4);
Serial.print(Sensor.getAccelerometerYaxis(), 4);
Serial.print('\t');
Serial.print("Z_axis: ");
Serial.println(Sensor.getdata_Accelerometer_zaxis(), 4);
Serial.println(Sensor.getAccelerometerZaxis(), 4);
Serial.println();
}

2 changes: 1 addition & 1 deletion examples/01. evive/08.Phone Sensor/Barometer/Barometer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void loop() {
void print_Barometer_data()
{
Serial.print("Barometer: ");
Serial.println(Sensor.getdata_Barometer(), 7);
Serial.println(Sensor.getBarometerPressure(), 7);
Serial.println();
}

Expand Down
4 changes: 2 additions & 2 deletions examples/01. evive/08.Phone Sensor/GPS/GPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ void loop() {
void print_GPS_data()
{
Serial.print("Longitude: ");
Serial.print(Sensor.getdata_GPS_longitude(), 7);
Serial.print(Sensor.getGPSlongitude(), 7);
Serial.print('\t');
Serial.print('\t');
Serial.print("Latitude: ");
Serial.println(Sensor.getdata_GPS_latitude(), 7);
Serial.println(Sensor.getGPSlatitude(), 7);
Serial.println();
}

Expand Down
6 changes: 3 additions & 3 deletions examples/01. evive/08.Phone Sensor/Gyroscope/Gyroscope.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ void loop() {
void print_Gyroscope_data()
{
Serial.print("X-axis: ");
Serial.print(Sensor.getdata_Gyroscope_xaxis());
Serial.print(Sensor.getGyroscopeXaxis());
Serial.print('\t');
Serial.print("Y-axis: ");
Serial.print(Sensor.getdata_Gyroscope_yaxis());
Serial.print(Sensor.getGyroscopeYaxis());
Serial.print('\t');
Serial.print("Z-axis: ");
Serial.println(Sensor.getdata_Gyroscope_zaxis());
Serial.println(Sensor.getGyroscopeZaxis());
Serial.println();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/01. evive/08.Phone Sensor/Light/Light.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ void loop() {
void print_Light_data()
{
Serial.print("LIGHT: ");
Serial.println(Sensor.getdata_Light(), 7);
Serial.println(Sensor.getLightIntensity(), 7);
Serial.println();
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ void loop() {
void print_Magnetometer_data()
{
Serial.print("X-axis: ");
Serial.print(Sensor.getdata_Magnetometer_xaxis(), 7);
Serial.print(Sensor.getMagnetometerXaxis(), 7);
Serial.print('\t');
Serial.print("Y-axis: ");
Serial.print(Sensor.getdata_Magnetometer_yaxis(), 7);
Serial.print(Sensor.getMagnetometerYaxis(), 7);
Serial.print('\t');
Serial.print("Z-axis: ");
Serial.println(Sensor.getdata_Magnetometer_zaxis(), 7);
Serial.println(Sensor.getMagnetometerZaxis(), 7);
Serial.println();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/01. evive/08.Phone Sensor/Proximity/Proximity.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void loop() {
void print_Proximity_data()
{
Serial.print("Distance: ");
Serial.println(Sensor.getdata_Proximity(), 7);
Serial.println(Sensor.getProximityDistance(), 7);
Serial.println();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/01. evive/08.Phone Sensor/Sound/Sound.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void loop() {
void print_Sound_data()
{
Serial.print("SOUND: ");
Serial.println(Sensor.getdata_Sound(), 3);
Serial.println(Sensor.getSoundDecibels(), 3);
Serial.println();
}

Expand Down
88 changes: 88 additions & 0 deletions examples/02. Uno Nano Mega/03.Gamepad/03.Gamepad.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
Gamepad module provides three different mode namely Digital, JoyStick and Accerleometer.
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/game-pad-module/
*/
#define CUSTOM_SETTINGS
#define INCLUDE_GAMEPAD_MODULE
#include <Dabble.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(250000); // make sure your Serial Monitor is also set at this baud rate.
Dabble.begin(9600); //Enter baudrate of your bluetooth.Connect bluetooth on Bluetooth port present on evive.
}

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.
Serial.print("KeyPressed: ");
if (GamePad.isUpPressed())
{
Serial.print("UP");
}

if (GamePad.isDownPressed())
{
Serial.print("DOWN");
}

if (GamePad.isLeftPressed())
{
Serial.print("Left");
}

if (GamePad.isRightPressed())
{
Serial.print("Right");
}

if (GamePad.isSquarePressed())
{
Serial.print("Square");
}

if (GamePad.isCirclePressed())
{
Serial.print("Circle");
}

if (GamePad.isCrossPressed())
{
Serial.print("Cross");
}

if (GamePad.isTrianglePressed())
{
Serial.print("Triangle");
}

if (GamePad.isStartPressed())
{
Serial.print("Start");
}

if (GamePad.isSelectPressed())
{
Serial.print("Select");
}
Serial.print('\t');

int a = GamePad.getAngle();
Serial.print("Angle: ");
Serial.print(a);
Serial.print('\t');
int b = GamePad.getRadius();
Serial.print("Radius: ");
Serial.print(b);
Serial.print('\t');
float c = GamePad.getXaxisData();
Serial.print("x_axis: ");
Serial.print(c);
Serial.print('\t');
float d = GamePad.getYaxisData();
Serial.print("y_axis: ");
Serial.println(d);
Serial.println();
}
12 changes: 6 additions & 6 deletions examples/02. Uno Nano Mega/06.Inputs/06.Inputs.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ void setup() {
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.
Serial.print("Pot1:");
Serial.print(Inputs.getvalue_Pot1());
Serial.print(Inputs.getPot1Value());
Serial.print('\t');
Serial.print("Pot2:");
Serial.print(Inputs.getvalue_Pot2());
Serial.print(Inputs.getPot2Value());
Serial.print('\t');
Serial.print("SS1:");
Serial.print(Inputs.getStatus_SlideSwitch1());
Serial.print(Inputs.getSlideSwitch1Value());
Serial.print('\t');
Serial.print("SS2:");
Serial.print(Inputs.getStatus_SlideSwitch2());
Serial.print(Inputs.getSlideSwitch2Value());
Serial.print('\t');
Serial.print("TS1:");
Serial.print(Inputs.getStatus_TactileSwitch1());
Serial.print(Inputs.getTactileSwitch1Value());
Serial.print('\t');
Serial.print("TS2:");
Serial.print(Inputs.getStatus_TactileSwitch2());
Serial.print(Inputs.getTactileSwitch2Value());
Serial.println();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void loop() {
void print_Accelerometer_data()
{
Serial.print("X_axis: ");
Serial.print(Sensor.getdata_Accelerometer_xaxis(), 4);
Serial.print(Sensor.getAccelerometerXaxis(), 4);
Serial.print('\t');
Serial.print("Y_axis: ");
Serial.print(Sensor.getdata_Accelerometer_yaxis(), 4);
Serial.print(Sensor.getAccelerometerYaxis(), 4);
Serial.print('\t');
Serial.print("Z_axis: ");
Serial.println(Sensor.getdata_Accelerometer_zaxis(), 4);
Serial.println(Sensor.getAccelerometerZaxis(), 4);
Serial.println();
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void loop() {
void print_Barometer_data()
{
Serial.print("Barometer: ");
Serial.println(Sensor.getdata_Barometer(), 7);
Serial.println(Sensor.getBarometerPressure(), 7);
Serial.println();
}

Expand Down
4 changes: 2 additions & 2 deletions examples/02. Uno Nano Mega/08.Phone Sensor/GPS/GPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ void loop() {
void print_GPS_data()
{
Serial.print("Longitude: ");
Serial.print(Sensor.getdata_GPS_longitude(), 7);
Serial.print(Sensor.getGPSlongitude(), 7);
Serial.print('\t');
Serial.print("Latitude: ");
Serial.println(Sensor.getdata_GPS_latitude(), 7);
Serial.println(Sensor.getGPSlatitude(), 7);
Serial.println();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void loop() {
void print_Gyroscope_data()
{
Serial.print("X_axis: ");
Serial.print(Sensor.getdata_Gyroscope_xaxis(), 7);
Serial.print(Sensor.getGyroscopeXaxis(), 7);
Serial.print('\t');
Serial.print("Y_axis: ");
Serial.print(Sensor.getdata_Gyroscope_yaxis(), 7);
Serial.print(Sensor.getGyroscopeYaxis(), 7);
Serial.print('\t');
Serial.print("Z_axis: ");
Serial.println(Sensor.getdata_Gyroscope_zaxis(), 7);
Serial.println(Sensor.getGyroscopeZaxis(), 7);
Serial.println();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/02. Uno Nano Mega/08.Phone Sensor/Light/Light.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ void loop() {
void print_Light_data()
{
Serial.print("LIGHT: ");
Serial.println(Sensor.getdata_Light(), 7);
Serial.println(Sensor.getLightIntensity(), 7);
Serial.println();
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ void loop() {
void print_Magnetometer_data()
{
Serial.print("X_axis: ");
Serial.print(Sensor.getdata_Magnetometer_xaxis(), 7);
Serial.print(Sensor.getMagnetometerXaxis(), 7);
Serial.print('\t');
Serial.print("Y_axis: ");
Serial.print(Sensor.getdata_Magnetometer_yaxis(), 7);
Serial.print(Sensor.getMagnetometerYaxis(), 7);
Serial.print('\t');
Serial.print("Z_axis: ");
Serial.println(Sensor.getdata_Magnetometer_zaxis(), 7);
Serial.println(Sensor.getMagnetometerZaxis(), 7);
Serial.println();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void loop() {
void print_Proximity_data()
{
Serial.print("Distance: ");
Serial.println(Sensor.getdata_Proximity(), 7);
Serial.println(Sensor.getProximityDistance(), 7);
Serial.println();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/02. Uno Nano Mega/08.Phone Sensor/Sound/Sound.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void loop() {
void print_Sound_data()
{
Serial.print("SOUND: ");
Serial.println(Sensor.getdata_Sound(), 7);
Serial.println(Sensor.getSoundDecibels(), 7);
Serial.println();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void loop() {
void print_Temperature_data()
{
Serial.print("TEMPERATURE: ");
Serial.println(Sensor.getdata_Temperature(), 7);
Serial.println(Sensor.getTemperature(), 7);
Serial.println();
}

Expand Down
Loading

0 comments on commit a914cc6

Please sign in to comment.