Skip to content

Commit 079181a

Browse files
committed
Title update and numbered list
1 parent a56f58a commit 079181a

File tree

1 file changed

+15
-17
lines changed
  • content/hardware/07.opta/opta-family/opta/tutorials/18.conveyor-sorting-app-note

1 file changed

+15
-17
lines changed

content/hardware/07.opta/opta-family/opta/tutorials/18.conveyor-sorting-app-note/content.md

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
2-
title: 'Color Sorting and Remote Monitoring with Opta™'
2+
title: 'Conveyor belt sorting with remote monitoring using Opta™'
33
difficulty: intermediate
44
description: "This application note describes how to remotely control and monitor a conveyor and sorting system in real time using the Opta™ and its built-in cloud connectivity."
5-
65
tags:
76
- cloud
87
- conveyor
@@ -11,7 +10,6 @@ tags:
1110
- opta
1211
- color
1312
author: 'Davidson Dantas and Thiago Alves'
14-
1513
hardware:
1614
- hardware/07.opta/opta-family/opta
1715
---
@@ -555,19 +553,19 @@ void setup() {
555553

556554
The `setup` function in Arduino programming is a crucial function that executes once when the Arduino board is powered on or reset. It’s responsible for initializing settings and configuring the system before the main program starts running. In the `setup` function, you typically establish communication (such as starting the serial monitor), configure pin modes, connect to networks, and initialize variables and libraries. This function ensures the Arduino is fully prepared for the `loop` function that follows, allowing for continuous and smooth operation. In this sketch, we are setting up:
557555

558-
1. **Serial Communication Initialization**:
556+
**Serial Communication Initialization**:
559557
- `Serial.begin(9600);`: Initializes the serial communication at a baud rate of 9600 bps, allowing you to monitor the device's output through the Serial Monitor.
560558

561-
2. **Delay**:
559+
**Delay**:
562560
- `delay(1500);`: A delay of 1.5 seconds is introduced to ensure that the Serial Monitor has time to open before continuing.
563561

564-
3. **Properties Initialization**:
562+
**Properties Initialization**:
565563
- `initProperties();`: This function is defined later in the code and is responsible for linking the local variables with the Arduino Cloud properties.
566564

567-
4. **Arduino Cloud Connection**:
565+
**Arduino Cloud Connection**:
568566
- `ArduinoCloud.begin(ArduinoIoTPreferredConnection);`: This command connects the device to the Arduino Cloud using the specified WiFi credentials.
569567

570-
5. **Debugging Information**:
568+
**Debugging Information**:
571569
- `setDebugMessageLevel(2);`: Sets the level of debug information. A higher number provides more detailed information about network and cloud connection states. The default is 0 (only errors), and the maximum is 4 (most detailed).
572570
- `ArduinoCloud.printDebugInfo();`: Prints debug information about the cloud connection to the Serial Monitor.
573571

@@ -592,25 +590,25 @@ void loop() {
592590

593591
The `loop` function in Arduino programming is a core function that runs continuously after the setup function has finished executing. This is where the main logic of your program resides. The `loop` function repeats over and over, allowing the Arduino to check inputs, control outputs, and perform tasks repeatedly as long as the board is powered on. It’s in this function that you’ll handle real-time operations, such as reading sensor data, controlling motors, or updating displays. By continuously executing the code within loop, the Arduino can respond dynamically to changes in its environment, ensuring ongoing and responsive operation. The loop function in this sketch is responsible for:
594592

595-
1. **Cloud Connection Maintenance**:
593+
**Cloud Connection Maintenance**:
596594
- `ArduinoCloud.update();`: This function keeps the connection to the Arduino Cloud alive and synchronizes the cloud-linked variables with their current values.
597595

598-
2. **Start Button Status**:
596+
**Start Button Status**:
599597
- `cloudStartButton = PLCOut.out_cloudStartButtonStatus;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
600598

601-
3. **Stop Button Status**:
599+
**Stop Button Status**:
602600
- `cloudStopButton = PLCOut.out_cloudStopButtonStatus;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
603601

604-
4. **System Running Status**:
602+
**System Running Status**:
605603
- `cloudRunningSystem = PLCOut.out_cloudRunningSystem;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
606604

607-
5. **Red Items Sorted Count**:
605+
**Red Items Sorted Count**:
608606
- `cloudRedSorted = PLCOut.out_counterRed;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
609607

610-
6. **Green Items Sorted Count**:
608+
**Green Items Sorted Count**:
611609
- `cloudGreenSorted = PLCOut.out_counterGreen;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
612610

613-
7. **Blue Items Sorted Count**:
611+
**Blue Items Sorted Count**:
614612
- `cloudBlueSorted = PLCOut.out_counterBlue;`: Synchronizes the variable in the PLC with the variable in the Arduino Cloud.
615613

616614
### Fourth Section: InitProperties and Callbacks
@@ -647,15 +645,15 @@ void onStopButtonChange() {
647645

648646
**Explanation:**
649647

650-
1. **`initProperties` Function**:
648+
**initProperties Function**:
651649

652650
`ArduinoCloud.update();`: This function links the cloud variables with their respective properties in the Arduino Cloud. Each property is set with specific attributes:
653651
- **`READWRITE`**: The property can be read from and written to by the cloud.
654652
- **`READ`**: The property can only be read by the cloud.
655653
- **`ON_CHANGE`**: The associated function (callback) is called whenever the value of the property changes.
656654
- `onStartButtonChange` and `onStopButtonChange` are callback functions that execute whenever the `cloudStartButton` or `cloudStopButton` values change.
657655

658-
2. **Callback Functions**:
656+
**Callback Functions**:
659657
- **`onStartButtonChange()`**: Updates the local start button state (`PLCIn.in_cloudStartButton`) whenever the `cloudStartButton` value changes in the cloud.
660658
- **`onStopButtonChange()`**: Updates the local stop button state (`PLCIn.in_cloudStopButton`) whenever the `cloudStopButton` value changes in the cloud.
661659

0 commit comments

Comments
 (0)