Skip to content

Commit d7393a5

Browse files
Merge pull request #4 from arduino-libraries/lib_refactoring
Library revamping
2 parents ca7ff9b + bbb3fe0 commit d7393a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3157
-1524
lines changed

.github/workflows/compile-examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
libraries: |
4646
- source-path: ./
4747
- name: ArduinoRS485
48+
- name: Arduino_AdvancedAnalog
4849
sketch-paths: |
4950
- examples
5051
enable-deltas-report: true

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# Portenta Machine Control Library for Arduino
1+
# 🏭 Library for Portenta Machine Control
22

3-
[![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)
4-
[![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)
5-
[![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)
3+
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.
64

7-
Arduino Library for the Portenta Machine Control
5+
The Machine Control library enables efficient management of the features of the Portenta Machine Control board.
86

9-
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.
7+
📦 For more information about this product:
8+
https://www.arduino.cc/pro/hardware/product/portenta-machine-control
109

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

1412
## License
1513

14+
```
1615
Copyright (c) 2021 Arduino SA. All rights reserved.
1716
1817
This library is free software; you can redistribute it and/or
@@ -28,3 +27,4 @@ Lesser General Public License for more details.
2827
You should have received a copy of the GNU Lesser General Public
2928
License along with this library; if not, write to the Free Software
3029
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30+
```

docs/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Portenta Machine Control Library
2+
3+
[![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)
4+
[![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)
5+
[![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)
6+
7+
[![License](https://img.shields.io/badge/License-LGPLv2.1-blue.svg)](https://github.com/arduino-libraries/Arduino_MachineControl/blob/master/LICENSE.txt)
8+
9+
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.
10+
11+
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.
12+
13+
📚 For more information about this library please visit us at:
14+
https://www.arduino.cc/reference/en/libraries/arduino_machinecontrol
15+
16+
## Features
17+
18+
- Manages input signals, including:
19+
- 8 digital inputs at 24Vdc
20+
- 2 channels for encoder readings
21+
- 3 analog inputs for PT100/J/K temperature probes
22+
- 3 analog inputs for 4-20mA/0-10V/NTC signals
23+
24+
- Manages output signals, including:
25+
- 8 digital outputs at 24Vdc
26+
- 4 analog outputs at 0-10V
27+
28+
- Provides control for other I/O:
29+
- 12 programmable digital I/O at 24V
30+
31+
- Supports various communication protocols:
32+
- CAN-BUS
33+
- Serial protocols (RS232/RS422/RS485)
34+
- USB
35+
36+
- Handles RTC (Real-Time Clock) functionality
37+
38+
## Usage
39+
40+
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.
41+
42+
Here is a minimal example to control a digital output:
43+
44+
```cpp
45+
// Include the Arduino MachineControl library
46+
#include <Arduino_MachineControl.h>
47+
48+
void setup() {
49+
// Initialize the digital outputs module of the MachineControl library
50+
MachineControl_DigitalOutputs.begin();
51+
}
52+
53+
void loop() {
54+
// Turn on the digital output at channel 0
55+
MachineControl_DigitalOutputs.write(0, HIGH);
56+
delay(1000);
57+
// Turn off the digital output at channel 0
58+
MachineControl_DigitalOutputs.write(0, LOW);
59+
delay(1000);
60+
}
61+
```
62+
63+
## Examples
64+
65+
- **[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.
66+
- **[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.
67+
- **[Analog_input_NTC](../examples/Analog_input/Analog_input_NTC):** This example shows reading analog input signals from NTC temperature probes.
68+
- **[Analog_Out](../examples/Analog_Out):** This example shows how to control analog output signals.
69+
- **[ReadCan](../examples/CAN/ReadCan):** This example demonstrates how to read data using the CAN-BUS communication protocol.
70+
- **[WriteCan](../examples/CAN/WriteCan):** This example demonstrates how to send data using the CAN-BUS communication protocol.
71+
- **[Digital_output](../examples/Digital_output):** This example shows how to control digital output signals.
72+
- **[Digital_input](../examples/Digital_programmable/Digital_input):** This example shows how to read digital input signals.
73+
- **[GPIO_programmable](../examples/Digital_programmable/GPIO_programmable):** This example demonstrates the usage of programmable digital I/O pins.
74+
- **[Encoders](../examples/Encoders):** This example shows how to work with encoder readings.
75+
- **[Ethernet](../examples/Ethernet):** This example shows how to establish Ethernet communication and connects to a website.
76+
- **[RS232](../examples/RS232):** This example demonstrates serial communication using the RS232 protocol.
77+
- **[RS485_fullduplex](../examples/RS485_fullduplex):** This example demonstrates full-duplex serial communication using the RS485 protocol.
78+
- **[RS485_halfduplex](../examples/RS485_halfduplex):** This example demonstrates half-duplex serial communication using the RS485 protocol.
79+
- **[RTC](../examples/RTC):** This example shows how to interact with the Real-Time Clock functionality.
80+
- **[RTC_Alarm](../examples/RTC_Alarm):** This example demonstrates how to set up and utilize RTC alarms.
81+
- **[Temp_probes_RTD](../examples/Temp_probes_RTD):** This example demonstrates the temperature probe readings using RTD sensors.
82+
- **[Temp_probes_Thermocouples](../examples/Temp_probes_Thermocouples):** This example demonstrates the temperature probe readings using thermocouple sensors.
83+
- **[USB_host](../examples/USB_host):** This example shows the USB host functionality.
84+
85+
## API
86+
87+
The API documentation can be found [here](./api.md).
88+
89+
## License
90+
91+
This library is released under the [LGPLv2.1 license](https://github.com/arduino-libraries/Arduino_MachineControl/blob/master/LICENSE.txt).

0 commit comments

Comments
 (0)