Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
569ddab
User Manual Folder created
mcmchris Sep 19, 2023
eb37a03
User Manual writing commit 1
mcmchris Sep 19, 2023
1f95891
Typo fix
mcmchris Sep 19, 2023
78e1552
User Manual writing commit 2
mcmchris Sep 19, 2023
75217f4
User Manual writing commit 3
mcmchris Sep 20, 2023
fcf731b
User Manual writing commit 4
mcmchris Sep 20, 2023
03f05b1
Images order change
mcmchris Sep 21, 2023
3c86be6
User Manual writing commit 5
mcmchris Sep 21, 2023
286ae85
User Manual writing commit 6
mcmchris Sep 21, 2023
63f9e25
User Manual writing commit 7
mcmchris Sep 21, 2023
2de52e2
User Manual writing commit 8
mcmchris Sep 25, 2023
ad925bf
User Manual writing commit 9
mcmchris Sep 25, 2023
981dc34
User Manual writing commit 10
mcmchris Sep 26, 2023
1235dfc
User Manual writing commit 11
mcmchris Sep 27, 2023
847b169
User Manual writing commit 12
mcmchris Sep 28, 2023
ef80511
Typo Fix
mcmchris Sep 28, 2023
9b00ef0
User Manual writing commit 13
mcmchris Sep 29, 2023
a204411
User Manual writing commit 14
mcmchris Oct 1, 2023
2a69cce
User Manual writing commit 15
mcmchris Oct 2, 2023
0931f88
User Manual writing commit 16
mcmchris Oct 2, 2023
e92e598
User Manual writing commit 17
mcmchris Oct 2, 2023
34cf055
User Manual writing commit 18
mcmchris Oct 2, 2023
0b6adef
User Manual writing commit 19
mcmchris Oct 3, 2023
0633987
User Manual writing commit 20
mcmchris Oct 3, 2023
adcf89b
User Manual writing commit 21
mcmchris Oct 3, 2023
c14d841
Final commit 22
mcmchris Oct 3, 2023
77cbfe2
Typos fix 1
mcmchris Oct 3, 2023
bb92359
Typos fix 2
mcmchris Oct 3, 2023
782d985
Typos fix 3
mcmchris Oct 3, 2023
7edf283
Typos fix 4
mcmchris Oct 3, 2023
5591243
Punctuation fix 1
mcmchris Oct 3, 2023
1d570fb
Rephrase fix 1
mcmchris Oct 3, 2023
f2cafdd
Typos fix 5
mcmchris Oct 3, 2023
b323fcf
Structure fix 1
mcmchris Oct 3, 2023
c547763
Gif size update
mcmchris Oct 3, 2023
b50ee27
Checking if spell fixes worked
mcmchris Oct 4, 2023
24bee1d
Edge Control Forum URL fixed
mcmchris Oct 4, 2023
acbb95d
Simple Pinout update
mcmchris Nov 20, 2023
466e33a
Tables update
mcmchris Nov 20, 2023
e32b6d5
I2C section extended
mcmchris Nov 20, 2023
c41a264
Metadata update to see preview
mcmchris Jan 24, 2024
898649a
Metadata update to see preview
mcmchris Jan 24, 2024
2ada41c
Merge branch 'main' into mcmchris/edge-control/user-manual
mcmchris Sep 16, 2024
962ab70
Merge branch 'main' into mcmchris/edge-control/user-manual
mcmchris Sep 16, 2024
bb192b2
Author name updated
mcmchris Sep 16, 2024
e03dd55
Taddy suggested changes 1
mcmchris Sep 17, 2024
f1f9894
Taddy review applied
mcmchris Sep 17, 2024
1d46666
Library note
mcmchris Sep 17, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
User Manual writing commit 9
  • Loading branch information
mcmchris committed Sep 25, 2023
commit ad925bf88a505dfc55e131d33b7d87da34478316
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,16 @@ You should now see the onboard LED turn on for half a second, then off, repeated
### Analog Inputs
The Edge Control has **eight analog input pins**, mapped as follows:

| **Input Name** | **Arduino Pin Mapping**|
|:-------------------------:|:----------------------:|
| `INPUT_05V_CH01` | `0` |
| `INPUT_05V_CH02` | `1` |
| `INPUT_05V_CH03` | `2` |
| `INPUT_05V_CH04` | `3` |
| `INPUT_05V_CH05` | `4` |
| `INPUT_05V_CH06` | `5` |
| `INPUT_05V_CH07` | `6` |
| `INPUT_05V_CH08` | `7` |
| **Input Name** | **Arduino Pin Mapping** |
|:-------------------------:|:-----------------------------------:|
| `0-5V Channel 1` | `INPUT_05V_CH01` |
| `0-5V Channel 2` | `INPUT_05V_CH02` |
| `0-5V Channel 3` | `INPUT_05V_CH03` |
| `0-5V Channel 4` | `INPUT_05V_CH04` |
| `0-5V Channel 5` | `INPUT_05V_CH05` |
| `0-5V Channel 6` | `INPUT_05V_CH06` |
| `0-5V Channel 7` | `INPUT_05V_CH07` |
| `0-5V Channel 8` | `INPUT_05V_CH08` |

Every pin can be used through the built-in functions of the Arduino programming language.

Expand Down Expand Up @@ -304,8 +304,94 @@ Voltages getAverageAnalogRead(int pin)

```


### IRQ Inputs

The Edge Control has **six interrupt request input pins**, mapped as follows:

| **Input Name** | **Arduino Pin Mapping** |
|:------------------------------------:|:----------------------------:|
| `Interrupt Request Input 1` | `IRQ_CH1` |
| `Interrupt Request Input 2` | `IRQ_CH2` |
| `Interrupt Request Input 3` | `IRQ_CH3` |
| `Interrupt Request Input 4` | `IRQ_CH4` |
| `Interrupt Request Input 5` | `IRQ_CH5` |
| `Interrupt Request Input 6` | `IRQ_CH6` |

The IRQ inputs of the Edge Control can be used through the built-in functions of the Arduino programming language. The configuration of an interrupt pin is done in the `setup()` function with the built-in function `attachInterrupt()` as shown below:

```arduino
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
```
- The `pin` argument defines the input channel that will fire the interrupt.
- The `ISR` argument defines the callback function of the interrupt.
- The `mode` argument defines when the interrupt should be triggered.

The example code shown below counts the pulses on every IRQ input and prints the counter value on the IDE Serial Monitor:

This example code could also be found on **File > Examples > Arduino_EdgeControl > Basic > IRQCounter**

![IRQ input example wiring](assets/IRQ_example.png)

```arduino
/*
Testing strategy: alternatively create a short-time connection between
WAKEUP 1-6 and any of the +BAT_ext pins (the row above the WAKEUP ones).

Check IRQChannelMap for advanced C++ implementation.
*/

#include <Arduino_EdgeControl.h>

volatile int irqCounts[6] { };

enum IRQChannelsIndex {
irqChannel1 = 0,
irqChannel2,
irqChannel3,
irqChannel4,
irqChannel5,
irqChannel6
};


void setup()
{
EdgeControl.begin();

Serial.begin(115200);

// Wait for Serial Monitor or start after 2.5s
for (const auto timeout = millis() + 2500; millis() < timeout && !Serial; delay(250));

// Init IRQ INPUT pins
for (auto pin = IRQ_CH1; pin <= IRQ_CH6; pin++)
pinMode(pin, INPUT);

// Attach callbacks to IRQ pins
attachInterrupt(digitalPinToInterrupt(IRQ_CH1), []{ irqCounts[irqChannel1]++; }, RISING);
attachInterrupt(digitalPinToInterrupt(IRQ_CH2), []{ irqCounts[irqChannel2]++; }, RISING);
attachInterrupt(digitalPinToInterrupt(IRQ_CH3), []{ irqCounts[irqChannel3]++; }, RISING);
attachInterrupt(digitalPinToInterrupt(IRQ_CH4), []{ irqCounts[irqChannel4]++; }, RISING);
attachInterrupt(digitalPinToInterrupt(IRQ_CH5), []{ irqCounts[irqChannel5]++; }, RISING);
attachInterrupt(digitalPinToInterrupt(IRQ_CH6), []{ irqCounts[irqChannel6]++; }, RISING);

}

void loop()
{
// Check for received IRQ every second.
Serial.println("--------");
for (unsigned int i = irqChannel1; i <= irqChannel6; i++) {
Serial.print("IRQ Channel: ");
Serial.print(i + 1);
Serial.print(" - ");
Serial.println(irqCounts[i]);
}
delay(1000);
}

```

### 4-20mA Inputs
### Watermark Inputs

Expand Down