arduino-libraries / Arduino_MKRIoTCarrier

Use the features included with the Arduino MKR IoT Carrier
https://store.arduino.cc/mkr-iot-carrier
GNU Lesser General Public License v2.1
18 stars 11 forks source link

Add more Arduinish methods to set CARRIER_CASE #39

Closed alranel closed 2 years ago

alranel commented 3 years ago

As of now, the configuration of the library involves setting a global variable called CARRIER_CASE. This is not very Arduino-style and created some confusion in users who are asked to set a variable which is not declared within the sketch itself.

This pull request adds two methods that are more in line with the Arduino API style:

carrier.withCase();
carrier.noCase();

This change is retrocompatible so any sketch and tutorial using CARRIER_CASE is still valid, but for new content we might want to provide the new better looking calls.

This fixes #13.

github-actions[bot] commented 3 years ago

Memory usage change @ b22b6542e39394df0d8af87a02ad3e049b6ab90c

Board flash % RAM for global variables %
arduino:samd:mkrwifi1010 :green_heart: -8 - 0 -0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/Actuators/Buzzer_Melody
flash|%|examples/Actuators/Buzzer_Melody
RAM for global variables|%|examples/Actuators/Relays_blink
flash|%|examples/Actuators/Relays_blink
RAM for global variables|%|examples/All_Features
flash|%|examples/All_Features
RAM for global variables|%|examples/Grove_Inputs
flash|%|examples/Grove_Inputs
RAM for global variables|%|examples/LEDs-Examples/strandtest
flash|%|examples/LEDs-Examples/strandtest
RAM for global variables|%|examples/SD_card
flash|%|examples/SD_card
RAM for global variables|%|examples/Sensors/ENV-HTS221/ReadSensors
flash|%|examples/Sensors/ENV-HTS221/ReadSensors
RAM for global variables|%|examples/Sensors/ENV-HTS221/ReadSensorsImperial
flash|%|examples/Sensors/ENV-HTS221/ReadSensorsImperial
RAM for global variables|%|examples/Sensors/IMU-LSM6DS3/SimpleAccelerometer
flash|%|examples/Sensors/IMU-LSM6DS3/SimpleAccelerometer
RAM for global variables|%|examples/Sensors/IMU-LSM6DS3/SimpleGyroscope
flash|%|examples/Sensors/IMU-LSM6DS3/SimpleGyroscope
RAM for global variables|%|examples/Sensors/Light-APDS9960/FullExample
flash|%|examples/Sensors/Light-APDS9960/FullExample
RAM for global variables|%|examples/Sensors/Light-APDS9960/GestureSensor
flash|%|examples/Sensors/Light-APDS9960/GestureSensor
RAM for global variables|%|examples/Sensors/Light-APDS9960/ProximitySensor
flash|%|examples/Sensors/Light-APDS9960/ProximitySensor
RAM for global variables|%|examples/Sensors/Light-APDS9960/Read_Colors
flash|%|examples/Sensors/Light-APDS9960/Read_Colors
RAM for global variables|%|examples/Sensors/Pressure-LPS22HB/ReadPressure
flash|%|examples/Sensors/Pressure-LPS22HB/ReadPressure
RAM for global variables|%|examples/Sensors/Pressure-LPS22HB/ReadPressureImperial
flash|%|examples/Sensors/Pressure-LPS22HB/ReadPressureImperial
RAM for global variables|%|examples/TouchPads/Custom_Sensitivity
flash|%|examples/TouchPads/Custom_Sensitivity
RAM for global variables|%|examples/TouchPads/Relays_control_Qtouch
flash|%|examples/TouchPads/Relays_control_Qtouch
RAM for global variables|%|examples/TouchPads/TouchTypes
flash|%|examples/TouchPads/TouchTypes
RAM for global variables|%|examples/TouchPads/Touch_and_LEDs
flash|%|examples/TouchPads/Touch_and_LEDs
RAM for global variables|%|examples/TouchPads/Touch_signals
flash|%|examples/TouchPads/Touch_signals
RAM for global variables|%|examples/TouchPads/getTouch
flash|%|examples/TouchPads/getTouch
RAM for global variables|%|examples/Display/Compose_images
flash|%|examples/Display/Compose_images
RAM for global variables|%|examples/Display/Graphics
flash|%|examples/Display/Graphics
RAM for global variables|% -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- arduino:samd:mkrwifi1010|-8|-0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/Actuators/Buzzer_Melody
flash,%,examples/Actuators/Buzzer_Melody
RAM for global variables,%,examples/Actuators/Relays_blink
flash,%,examples/Actuators/Relays_blink
RAM for global variables,%,examples/All_Features
flash,%,examples/All_Features
RAM for global variables,%,examples/Grove_Inputs
flash,%,examples/Grove_Inputs
RAM for global variables,%,examples/LEDs-Examples/strandtest
flash,%,examples/LEDs-Examples/strandtest
RAM for global variables,%,examples/SD_card
flash,%,examples/SD_card
RAM for global variables,%,examples/Sensors/ENV-HTS221/ReadSensors
flash,%,examples/Sensors/ENV-HTS221/ReadSensors
RAM for global variables,%,examples/Sensors/ENV-HTS221/ReadSensorsImperial
flash,%,examples/Sensors/ENV-HTS221/ReadSensorsImperial
RAM for global variables,%,examples/Sensors/IMU-LSM6DS3/SimpleAccelerometer
flash,%,examples/Sensors/IMU-LSM6DS3/SimpleAccelerometer
RAM for global variables,%,examples/Sensors/IMU-LSM6DS3/SimpleGyroscope
flash,%,examples/Sensors/IMU-LSM6DS3/SimpleGyroscope
RAM for global variables,%,examples/Sensors/Light-APDS9960/FullExample
flash,%,examples/Sensors/Light-APDS9960/FullExample
RAM for global variables,%,examples/Sensors/Light-APDS9960/GestureSensor
flash,%,examples/Sensors/Light-APDS9960/GestureSensor
RAM for global variables,%,examples/Sensors/Light-APDS9960/ProximitySensor
flash,%,examples/Sensors/Light-APDS9960/ProximitySensor
RAM for global variables,%,examples/Sensors/Light-APDS9960/Read_Colors
flash,%,examples/Sensors/Light-APDS9960/Read_Colors
RAM for global variables,%,examples/Sensors/Pressure-LPS22HB/ReadPressure
flash,%,examples/Sensors/Pressure-LPS22HB/ReadPressure
RAM for global variables,%,examples/Sensors/Pressure-LPS22HB/ReadPressureImperial
flash,%,examples/Sensors/Pressure-LPS22HB/ReadPressureImperial
RAM for global variables,%,examples/TouchPads/Custom_Sensitivity
flash,%,examples/TouchPads/Custom_Sensitivity
RAM for global variables,%,examples/TouchPads/Relays_control_Qtouch
flash,%,examples/TouchPads/Relays_control_Qtouch
RAM for global variables,%,examples/TouchPads/TouchTypes
flash,%,examples/TouchPads/TouchTypes
RAM for global variables,%,examples/TouchPads/Touch_and_LEDs
flash,%,examples/TouchPads/Touch_and_LEDs
RAM for global variables,%,examples/TouchPads/Touch_signals
flash,%,examples/TouchPads/Touch_signals
RAM for global variables,%,examples/TouchPads/getTouch
flash,%,examples/TouchPads/getTouch
RAM for global variables,%,examples/Display/Compose_images
flash,%,examples/Display/Compose_images
RAM for global variables,%,examples/Display/Graphics
flash,%,examples/Display/Graphics
RAM for global variables,% arduino:samd:mkrwifi1010,-8,-0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0 ```
GDJose commented 3 years ago

It could be a good idea, but we need to apply this change carefully since it implies updating all the sketches for Explore and Oplà. & some content around it. If we want to go with this change we will need to allocate some time to update everything before merging the changes. Please let me know if we are going to go ahead with this so we can plan it properly :)

alranel commented 3 years ago

Actually this does not require changing the existing content, as accessing CARRIER_CASE directly is still valid :) We make this available for new content