Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Library revamping #106

Closed
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
966f33d
AnalogIn class refactoring
leonardocavagnis Jul 10, 2023
0b73e34
create AnalogOutClass as separate module
leonardocavagnis Jul 12, 2023
86db1cc
AnalogOut class refactoring
leonardocavagnis Jul 12, 2023
fdc1c44
docs: cosmetics
leonardocavagnis Jul 12, 2023
e1d11c1
create DigitalOutputsClass as separate module
leonardocavagnis Jul 12, 2023
b01735b
DigitalOutputs class refactoring
leonardocavagnis Jul 12, 2023
273f4fd
docs: DigitalOutputsClass
leonardocavagnis Jul 13, 2023
0acb433
create ProgrammableDIOClass as separate module
leonardocavagnis Jul 13, 2023
bfec7b7
ProgrammableDIO class refactoring
leonardocavagnis Jul 25, 2023
321919b
create rogrammableDINClass as separate module
leonardocavagnis Jul 25, 2023
65a8eaf
ProgrammableDIN class refactoring
leonardocavagnis Jul 25, 2023
e5dda7d
create RTDClass as separate module
leonardocavagnis Jul 25, 2023
e651375
Class renaming: RTDClass -> TempProbesClass
leonardocavagnis Jul 25, 2023
478437f
TempProbes class refactoring
leonardocavagnis Jul 25, 2023
c28bb65
RtcController Class refactoring
leonardocavagnis Jul 26, 2023
4edfa60
create USBClass as separate module
leonardocavagnis Jul 26, 2023
e10ffbc
USBClass refactoring
leonardocavagnis Jul 26, 2023
02506aa
Encoder class refactoring
leonardocavagnis Jul 26, 2023
b0458ad
create COMMClass as separate module
leonardocavagnis Jul 26, 2023
a6af34e
COMM class refactoring
leonardocavagnis Jul 27, 2023
cee0a68
docs: update
leonardocavagnis Jul 28, 2023
01d4703
create two different classes for the comm protocol: CAN (CANCommClass…
leonardocavagnis Aug 1, 2023
30609f8
doc update: RS485CommClass
leonardocavagnis Aug 1, 2023
dc3631d
create two different classes for the temp probes: RTD (RTDTempProbeCl…
leonardocavagnis Aug 1, 2023
407b907
Encoder: remove operator [] to access encoder channel
leonardocavagnis Aug 2, 2023
50463b8
refactoring Ethernet example using Arduino Ethernet library
leonardocavagnis Aug 3, 2023
c091f4a
reimplement CANCommClass using Arduino_CAN library
leonardocavagnis Aug 4, 2023
1ab14b2
add pinout file (pins_mc)
leonardocavagnis Aug 7, 2023
a9d32a2
RTC alarm example: remove namespace
leonardocavagnis Aug 8, 2023
f0304db
doc: examples
leonardocavagnis Aug 8, 2023
228205c
MAX31855: fix constructor param
leonardocavagnis Aug 9, 2023
fe62475
doc: update README
leonardocavagnis Aug 11, 2023
ce11f9b
doc: removed unused keywords
leonardocavagnis Aug 11, 2023
c4c119b
doc: update docs/README.md
leonardocavagnis Aug 11, 2023
c8761a6
doc: add example folder links
leonardocavagnis Aug 11, 2023
83e97e3
doc: update docs/README.md
leonardocavagnis Aug 11, 2023
26bdb2a
doc: update API.md
leonardocavagnis Aug 17, 2023
b70a4b4
Update docs/README.md
leonardocavagnis Aug 17, 2023
dc6ae43
Update keywords.txt
leonardocavagnis Aug 22, 2023
7902817
Update library.properties
leonardocavagnis Aug 22, 2023
e3edfa7
AnalogIn: change sensor type management
leonardocavagnis Aug 24, 2023
c0bafb8
removing PT1000 example, not compatible
leonardocavagnis Sep 20, 2023
d418048
fix mispelling of RTC methods
leonardocavagnis Sep 21, 2023
3157745
Merge branch 'master' into lib_refactoring
leonardocavagnis Sep 29, 2023
00c8404
move PinDefinitions inclusion in cpp to avoid compilation issue
leonardocavagnis Nov 17, 2023
65c748c
add fast analog input read example using Arduino_AdvancedAnalog library
leonardocavagnis Nov 28, 2023
5edf8d8
Update compile-examples.yml
leonardocavagnis Dec 11, 2023
bbb3fe0
fix Thermocouple readings
leonardocavagnis Jan 10, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
libraries: |
- source-path: ./
- name: ArduinoRS485
- name: Arduino_AdvancedAnalog
sketch-paths: |
- examples
enable-deltas-report: true
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Portenta Machine Control Library for Arduino
# 🏭 Library for Portenta Machine Control

[![Check Arduino status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/check-arduino.yml)
[![Compile Examples status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/compile-examples.yml)
[![Spell Check status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/spell-check.yml)
The Arduino Portenta Machine Control is a versatile industrial unit for driving machinery. It offers soft-PLC control, diverse I/O options, and flexible network connectivity.

Arduino Library for the Portenta Machine Control
The Machine Control library enables efficient management of the features of the Portenta Machine Control board.

The Portenta Machine Control enhances existing products with minimal effort, allowing companies to implement a standard platform across different equipment models. It is now easy to create an infrastructure of interconnected machines, which can be controlled onsite or via the cloud when needed; moreover, human-machine interaction can be further enahnced via mobile apps thanks to BLE connectivity.
📦 For more information about this product:
https://www.arduino.cc/pro/hardware/product/portenta-machine-control

For more information about this library please visit us at https://www.arduino.cc/reference/en/libraries/arduino_machinecontrol/
For more information about this product: https://www.arduino.cc/pro/hardware/product/portenta-machine-control
📖 For more information about this library please read the documentation [here](./docs/).

## License

```
Copyright (c) 2021 Arduino SA. All rights reserved.

This library is free software; you can redistribute it and/or
Expand All @@ -28,3 +27,4 @@ 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 St, Fifth Floor, Boston, MA 02110-1301 USA
```
91 changes: 91 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Portenta Machine Control Library

[![Check Arduino status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/check-arduino.yml)
[![Compile Examples status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/compile-examples.yml)
[![Spell Check status](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/actions/workflows/spell-check.yml)

[![License](https://img.shields.io/badge/License-LGPLv2.1-blue.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/blob/master/LICENSE.txt)

The Portenta Machine Control Library is a C++ library designed to efficiently manage the functionalities of the Portenta Machine Control board. It provides extensive support for inputs such as digital, analog, and encoder signals, while offering outputs including digital and analog signals. This library also menages communication through protocols like CAN-BUS and serial ports, and allows connectivity via Ethernet, USB, Wi-Fi, and Bluetooth Low Energy.

The library empowers users to easily initialize, control, and access the diverse functionalities of the Portenta Machine Control, enhancing its capability and adaptability for industrial applications.

📚 For more information about this library please visit us at:
https://www.arduino.cc/reference/en/libraries/arduino_machinecontrol

## Features

- Manages input signals, including:
- 8 digital inputs at 24Vdc
- 2 channels for encoder readings
- 3 analog inputs for PT100/J/K temperature probes
- 3 analog inputs for 4-20mA/0-10V/NTC signals

- Manages output signals, including:
- 8 digital outputs at 24Vdc
- 4 analog outputs at 0-10V

- Provides control for other I/O:
- 12 programmable digital I/O at 24V

- Supports various communication protocols:
- CAN-BUS
- Serial protocols (RS232/RS422/RS485)
- USB

- Handles RTC (Real-Time Clock) functionality

## Usage

To use this library, you must have a properly powered Portenta Machine Control board running at 24V. Once you have ensured the correct power supply and established the connection, you can include the machine control library in your Arduino sketch and use its functions to manage the board features.

Here is a minimal example to control a digital output:

```cpp
// Include the Arduino MachineControl library
#include <Arduino_MachineControl.h>

void setup() {
// Initialize the digital outputs module of the MachineControl library
MachineControl_DigitalOutputs.begin();
}

void loop() {
// Turn on the digital output at channel 0
MachineControl_DigitalOutputs.write(0, HIGH);
delay(1000);
// Turn off the digital output at channel 0
MachineControl_DigitalOutputs.write(0, LOW);
delay(1000);
}
```

## Examples

- **[Analog_input_0_10V](../examples/Analog_input/Analog_input_0_10V):** This example demonstrates how to read analog input signals in the 0-10V range.
- **[Analog_input_4_20mA](../examples/Analog_input/Analog_input_4_20mA):** This example demonstrates how to read analog input signals in the 4-20mA range.
- **[Analog_input_NTC](../examples/Analog_input/Analog_input_NTC):** This example shows reading analog input signals from NTC temperature probes.
- **[Analog_Out](../examples/Analog_Out):** This example shows how to control analog output signals.
- **[ReadCan](../examples/CAN/ReadCan):** This example demonstrates how to read data using the CAN-BUS communication protocol.
- **[WriteCan](../examples/CAN/WriteCan):** This example demonstrates how to send data using the CAN-BUS communication protocol.
- **[Digital_output](../examples/Digital_output):** This example shows how to control digital output signals.
- **[Digital_input](../examples/Digital_programmable/Digital_input):** This example shows how to read digital input signals.
- **[GPIO_programmable](../examples/Digital_programmable/GPIO_programmable):** This example demonstrates the usage of programmable digital I/O pins.
- **[Encoders](../examples/Encoders):** This example shows how to work with encoder readings.
- **[Ethernet](../examples/Ethernet):** This example shows how to establish Ethernet communication and connects to a website.
- **[RS232](../examples/RS232):** This example demonstrates serial communication using the RS232 protocol.
- **[RS485_fullduplex](../examples/RS485_fullduplex):** This example demonstrates full-duplex serial communication using the RS485 protocol.
- **[RS485_halfduplex](../examples/RS485_halfduplex):** This example demonstrates half-duplex serial communication using the RS485 protocol.
- **[RTC](../examples/RTC):** This example shows how to interact with the Real-Time Clock functionality.
- **[RTC_Alarm](../examples/RTC_Alarm):** This example demonstrates how to set up and utilize RTC alarms.
- **[Temp_probes_RTD](../examples/Temp_probes_RTD):** This example demonstrates the temperature probe readings using RTD sensors.
- **[Temp_probes_Thermocouples](../examples/Temp_probes_Thermocouples):** This example demonstrates the temperature probe readings using thermocouple sensors.
- **[USB_host](../examples/USB_host):** This example shows the USB host functionality.

## API

The API documentation can be found [here](./api.md).

## License

This library is released under the [LGPLv2.1 license](https://github.com/arduino-libraries/Arduino_MachineControl/blob/master/LICENSE.txt).
Loading
Loading