Skip to content

Commit 12b7b85

Browse files
maxgerhardtper1234
andauthored
Apply suggestions from code review
Multiple naming and code formatting changes. Co-authored-by: per1234 <[email protected]>
1 parent e37f4b0 commit 12b7b85

File tree

3 files changed

+26
-27
lines changed

3 files changed

+26
-27
lines changed

libraries/OPAMP/README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
## Description
44

5-
The Arduino Uno R4 Minima and WiFi boards, both a featuring a Renesas R7FA4M1AB3CFM#AA0 microcontroller, do have a built-in OPAMP peripheral.
5+
The Arduino UNO R4 Minima and WiFi boards, both a featuring a Renesas R7FA4M1AB3CFM#AA0 microcontroller, do have a built-in OPAMP peripheral.
66

7-
OMAMPs are very versatile. They can:
7+
Operational amplifiers (or "op amp") are very versatile. They can:
88
* mirror an input voltage to its output ("voltage follower")
9-
* amplify a small analog voltage to its output pin, output voltage range from 0 to ~4.7V ("non-inverting amplifier")
9+
* amplify a small analog voltage to its output pin, output voltage range from 0 to ~4.7 V ("non-inverting amplifier")
1010
* compare two input voltages and give a binary "higher" or "lower" output ("comparator")
1111
* integrate and differentiate signals ("integrator", "differentiator")
1212
* many more
1313

1414
Electrical characteristics:
15-
* Input from 0.2V (low speed) / 0.3V (highspeed) to AVCC0 - 0.5V (lowspeed) to AVCC0 - 0.6V (high-speed)
16-
* Output from 0.1V to AVCC0 - 0.1V
17-
* Open gain: 120dB typical
18-
* Input offset voltage: -10 to 10mV
19-
* Gain-bandwidth product: 0.04MHz (low-speed) / 1.7 MHz (high-speed)
20-
* Load current: -100 to 100µA max.
15+
* Input from 0.2 V (low speed) / 0. 3V (highspeed) to AVCC0 - 0.5 V (lowspeed) to AVCC0 - 0.6 V (high-speed)
16+
* Output from 0.1 V to AVCC0 - 0.1 V
17+
* Open gain: 120 dB typical
18+
* Input offset voltage: -10 to 10 mV
19+
* Gain-bandwidth product: 0.04 MHz (low-speed) / 1.7 MHz (high-speed)
20+
* Load current: -100 to 100 µA max.
2121

2222
## Usage
2323

@@ -27,7 +27,7 @@ To startup the opamp, simply include the library and call `OPAMP.begin()`. You c
2727
#include <OPAMP.h>
2828

2929
void setup () {
30-
OPAMP.begin(OPAMP_SPEED_HIGHSPEED);
30+
OPAMP.begin(OPAMP_SPEED_HIGHSPEED);
3131
}
3232

3333
void loop() {}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
#include <Arduino.h>
21
#include <OPAMP.h>
32

43
void setup () {
5-
Serial.begin(9600);
6-
delay(2000); // serial monitor delay
7-
// activate OPAMP
8-
if(!OPAMP.begin(OPAMP_SPEED_HIGHSPEED)) {
9-
Serial.println("Failed to start OPAMP!");
10-
}
11-
uint8_t status = OPAMP.getStatus();
12-
if(status & (1u << 0u)) {
13-
Serial.println("OPAMP running on channel 0!");
14-
} else {
15-
Serial.println("OPAMP channel 0 is not running!");
16-
}
4+
Serial.begin(9600);
5+
delay(2000); // serial monitor delay
6+
// activate OPAMP
7+
if (!OPAMP.begin(OPAMP_SPEED_HIGHSPEED)) {
8+
Serial.println("Failed to start OPAMP!");
9+
}
10+
uint8_t status = OPAMP.getStatus();
11+
if (status & (1u << 0u)) {
12+
Serial.println("OPAMP running on channel 0!");
13+
} else {
14+
Serial.println("OPAMP channel 0 is not running!");
15+
}
1716
}
1817

1918
void loop() {
20-
delay(1000); // do nothing
19+
delay(1000); // do nothing
2120
}

libraries/OPAMP/library.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name=OPAMP
22
version=1.0.0
33
author=Maximilian Gerhardt
44
maintainer=Maximilian Gerhardt <[email protected]>
5-
sentence=Library for using the OPAMP on Arduino Uno R4 boards.
6-
paragraph=Supports OPAMP on Arduino Uno R4 (Minima, WiFI).
5+
sentence=Library for using the OPAMP on Arduino UNO R4 boards.
6+
paragraph=Supports OPAMP on Arduino UNO R4 (Minima, WiFi).
77
category=Signal Input/Output
8-
url=https://github.com/arduino/ArduinoCore-renesas/tree/master/libraries/OPAMP
8+
url=https://github.com/arduino/ArduinoCore-renesas/tree/main/libraries/OPAMP
99
architectures=renesas,renesas_uno
1010
includes=OPAMP.h

0 commit comments

Comments
 (0)