diff --git a/library.properties b/library.properties index 22da0eb..5aacf4d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_PortentaMachineControl -version=1.0.1 +version=1.0.2 author=Arduino maintainer=Arduino sentence=Arduino Library for Portenta Machine Control (PMC) diff --git a/src/DigitalOutputsClass.cpp b/src/DigitalOutputsClass.cpp index 97eb7a4..cf492f4 100644 --- a/src/DigitalOutputsClass.cpp +++ b/src/DigitalOutputsClass.cpp @@ -77,7 +77,7 @@ void DigitalOutputsClass::write(uint8_t channel, PinStatus val) { void DigitalOutputsClass::writeAll(uint8_t val_mask) { for (uint8_t ch = 0; ch < 8; ch++) { - if (val_mask && (1 << ch)) { + if (val_mask & (1 << ch)) { write(ch, HIGH); } else { write(ch, LOW); @@ -94,4 +94,4 @@ void DigitalOutputsClass::_setAutoRetryMode() { } DigitalOutputsClass MachineControl_DigitalOutputs; -/**** END OF FILE ****/ \ No newline at end of file +/**** END OF FILE ****/ diff --git a/src/utility/MAX31865/MAX31865.cpp b/src/utility/MAX31865/MAX31865.cpp index 985812e..cdcd1e4 100644 --- a/src/utility/MAX31865/MAX31865.cpp +++ b/src/utility/MAX31865/MAX31865.cpp @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2021 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "MAX31865.h" diff --git a/src/utility/MAX31865/MAX31865.h b/src/utility/MAX31865/MAX31865.h index f95969b..eb689af 100644 --- a/src/utility/MAX31865/MAX31865.h +++ b/src/utility/MAX31865/MAX31865.h @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2021 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #ifndef MAX31865_H #define MAX31865_H diff --git a/src/utility/RTC/PCF8563T.cpp b/src/utility/RTC/PCF8563T.cpp index 57d5a21..307eb96 100644 --- a/src/utility/RTC/PCF8563T.cpp +++ b/src/utility/RTC/PCF8563T.cpp @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2020 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "PCF8563T.h" #define PCF8563T_ADDRESS 0x51 diff --git a/src/utility/RTC/PCF8563T.h b/src/utility/RTC/PCF8563T.h index 12786cb..5ac6be5 100644 --- a/src/utility/RTC/PCF8563T.h +++ b/src/utility/RTC/PCF8563T.h @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2020 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #ifndef _PCF8563T_H_INCLUDED #define _PCF8563T_H_INCLUDED diff --git a/src/utility/THERMOCOUPLE/MAX31855.cpp b/src/utility/THERMOCOUPLE/MAX31855.cpp index 80f580e..03f5b23 100644 --- a/src/utility/THERMOCOUPLE/MAX31855.cpp +++ b/src/utility/THERMOCOUPLE/MAX31855.cpp @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2020 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "MAX31855.h" const double MAX31855Class::Jm210_760[] ; @@ -227,7 +208,7 @@ float MAX31855Class::readReferenceTemperature(int type) // The cold junction reference temperature is stored in the first 11 word's bits // sent by the Thermocouple-to-Digital Converter - rawword = rawword & 0x7FF; + rawword = rawword & 0xFFF; // check sign bit and convert to negative value. if (rawword & 0x800) { ref = (0xF800 | (rawword & 0x7FF))*0.0625; @@ -235,7 +216,7 @@ float MAX31855Class::readReferenceTemperature(int type) // multiply for the LSB value ref = rawword * 0.0625f; } - Serial.println(ref); + return ref; } diff --git a/src/utility/THERMOCOUPLE/MAX31855.h b/src/utility/THERMOCOUPLE/MAX31855.h index 4334c3c..f2924b7 100644 --- a/src/utility/THERMOCOUPLE/MAX31855.h +++ b/src/utility/THERMOCOUPLE/MAX31855.h @@ -1,22 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (c) 2020 Arduino SA. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #ifndef _MAX31855_H_ #define _MAX31855_H_ diff --git a/src/utility/ioexpander/ArduinoIOExpander.cpp b/src/utility/ioexpander/ArduinoIOExpander.cpp index 461e72e..b2c1738 100644 --- a/src/utility/ioexpander/ArduinoIOExpander.cpp +++ b/src/utility/ioexpander/ArduinoIOExpander.cpp @@ -1,19 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (C) 2020 Arduino AG (http://www.arduino.cc/) - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #include "ArduinoIOExpander.h" bool ArduinoIOExpanderClass::begin() diff --git a/src/utility/ioexpander/ArduinoIOExpander.h b/src/utility/ioexpander/ArduinoIOExpander.h index e7cd402..66e4de1 100644 --- a/src/utility/ioexpander/ArduinoIOExpander.h +++ b/src/utility/ioexpander/ArduinoIOExpander.h @@ -1,19 +1,3 @@ -/* - This file is part of the MachineControl library. - Copyright (C) 2020 Arduino AG (http://www.arduino.cc/) - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - #pragma once #include