Skip to content

V0.9.8 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Read more about the Kits:


For more information about this library please visit us at
https://www.arduino.cc/reference/en/libraries/arduino_mkriotcarrier/
http://www.arduino.cc/en/Reference/MKRIoTCarrier

## License

Expand Down
4 changes: 3 additions & 1 deletion examples/Actuators/Buzzer_Melody/Buzzer_Melody.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "pitches.h"

MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

// notes in the melody:
int melody[] = {
Expand All @@ -21,6 +20,9 @@ int noteDurations[] = {
};

void setup() {
CARRIER_CASE = false;
carrier.begin();

// iterate over the notes of the melody:
for (int thisNote = 0; thisNote < 8; thisNote++) {

Expand Down
2 changes: 1 addition & 1 deletion examples/Actuators/Relays_blink/Relays_blink.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <Arduino_MKRIoTCarrier.h>

MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {

Serial.begin(9600);
Serial.println("Init");
CARRIER_CASE = false;
carrier.begin();
}

Expand Down
4 changes: 1 addition & 3 deletions examples/All_Features/All_Features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Unless the touch pads
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier; //Constructor of the carrier maybe we can include it on the library itself

//Set the pad sense distance for using them with or without the enclosure
bool CARRIER_CASE = false;

float temperature;
float humidity;

Expand All @@ -27,6 +24,7 @@ void setup() {
while (!Serial); //Wait to open the Serial monitor to start the program and see details on errors

//Init everything and outputs the errors
CARRIER_CASE = false;
carrier.begin();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/Display/Compose_images/Compose_images.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;

bool CARRIER_CASE = false;

uint32_t orange = carrier.leds.Color(50, 242, 0);

void setup() {
Serial.begin(9600);
CARRIER_CASE = false;
carrier.begin();

uint16_t time = millis();
Expand Down
2 changes: 1 addition & 1 deletion examples/Display/Graphics/Graphics.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
MKRIoTCarrier carrier;

float p = 3.1415926;
bool CARRIER_CASE = false;

void setup(void) {

Serial.begin(9600);
Serial.print(F("Hello! ST77xx TFT Test"));
CARRIER_CASE = false;
carrier.begin();

uint16_t time = millis();
Expand Down
4 changes: 1 addition & 3 deletions examples/Grove_Inputs/Grove_Inputs.ino
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier; //Constructor of the carrier maybe we can include it on the library itself

//Set the pad sense distance for using them with or without the enclosure
bool CARRIER_CASE = false;

//Be sure that the Pins are the same as your wiring
int moisture = A5;
int moist;
Expand All @@ -14,6 +11,7 @@ void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(!Serial);
CARRIER_CASE = false;
carrier.begin();
pinMode(moisture,INPUT);
pinMode(pir,INPUT);
Expand Down
2 changes: 1 addition & 1 deletion examples/LEDs-Examples/strandtest/strandtest.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE;

#define NUMPIXELS 5

void setup() {
CARRIER_CASE = false;
carrier.begin();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/SD_card/SD_card.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

File myFile;

Expand All @@ -12,6 +11,7 @@ void setup() {
}

// Init the entire Carrier
CARRIER_CASE = false;
carrier.begin();

// open the file. note that only one file can be open at a time,
Expand Down
2 changes: 1 addition & 1 deletion examples/Sensors/ENV-HTS221/ReadSensors/ReadSensors.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;


void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
carrier.begin();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
carrier.begin();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Failed to initialize!");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial); // Wait for serial monitor to open

CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Error");
while (true); // Stop forever
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Error");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Error initializing APDS9960 sensor!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
carrier.begin();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);


CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Failed to initialize!");
while (1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

void setup() {
Serial.begin(9600);
while (!Serial);

CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Failed to initialize!");
while (1);
Expand Down
10 changes: 5 additions & 5 deletions examples/TouchPads/Custom_Sensitivity/Custom_Sensitivity.ino
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#include "Arduino_MKRIoTCarrier.h"
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

// When CARRIER_CASE is false it's set to 100 (closer)
// When CARRIER_CASE is true it's set to 4 (further)
// But if you use Buttons.updateConfig(value) It will not set the above values

unsigned int trheshold = 100;
unsigned int threshold = 100;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial);

//Now we can set our custom touch trheshold
carrier.Buttons.updateConfig(trheshold);
//CARRIER_CASE = false;
//Now we can set our custom touch threshold
carrier.Buttons.updateConfig(threshold);
carrier.begin();
}

void loop() {
// put your main code here, to run repeatedly:
carrier.Buttons.update();
//Lets test 1 button, they should all react in the same way
if (carrier.Button1.getTouch()) {
if (carrier.Button0.getTouch()) {
Serial.println("touching");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;

//False means Normally closed
bool newRelay1 = false;
Expand All @@ -16,6 +15,8 @@ uint32_t c_green = carrier.leds.Color(40, 0, 0);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

CARRIER_CASE = false;
carrier.begin();

carrier.leds.setPixelColor(0, c_green);
Expand All @@ -42,7 +43,7 @@ void loop() {
//The LED changes to Green its going to be NC (Normally Closed) or Orange to NO (Normally Open)
//Then the middle pad its going to upload the relay status, to confirm both new status

if (carrier.Button1.onTouchDown()) {
if (carrier.Button0.onTouchDown()) {
newRelay2 = !newRelay2;
if (newRelay2) {
carrier.leds.setPixelColor(0, c_orange);
Expand All @@ -52,7 +53,7 @@ void loop() {
carrier.leds.show();

}
if (carrier.Button5.onTouchDown()) {
if (carrier.Button4.onTouchDown()) {
newRelay1 = !newRelay1;
if (newRelay1) {
carrier.leds.setPixelColor(4, c_orange);
Expand All @@ -62,7 +63,7 @@ void loop() {
carrier.leds.show();
}

if (carrier.Button3.onTouchDown()) {
if (carrier.Button2.onTouchDown()) {
carrier.leds.setPixelColor(2, c_orange);
carrier.leds.show();

Expand Down Expand Up @@ -90,4 +91,4 @@ void loop() {

delay(20);

}
}
12 changes: 6 additions & 6 deletions examples/TouchPads/TouchTypes/TouchTypes.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
*/
#include <Arduino_MKRIoTCarrier.h>
MKRIoTCarrier carrier;
bool CARRIER_CASE = false;


void setup() {
Serial.begin(9600);
while (!Serial);
// Qtouch initialization
CARRIER_CASE = false;
if (!carrier.begin()) {
Serial.println("Error in sensors initialization!");
while (1);
Expand All @@ -30,19 +30,19 @@ void loop() {
// polling the sensor for new measure
carrier.Buttons.update();

if (carrier.Button1.onTouchDown()) {
if (carrier.Button0.onTouchDown()) {
Serial.println("Touched Down Button 1");
}
if (carrier.Button2.onTouchUp()) {
if (carrier.Button1.onTouchUp()) {
Serial.println("Release Touch Button 2");
}
if (carrier.Button3.onTouchChange()) {
if (carrier.Button2.onTouchChange()) {
Serial.println("Changed Touch Button 3");
}
if (carrier.Button4.getTouch()) {
if (carrier.Button3.getTouch()) {
Serial.println("Touching Button 4");
}
if (carrier.Button5.getTouch()) {
if (carrier.Button4.getTouch()) {
Serial.println("Touching Button 5");
}
delay(20);
Expand Down
Loading