MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MiniR4Analog.h
Go to the documentation of this file.
1
7#ifndef MiniR4Analog_H
8#define MiniR4Analog_H
9
10#include "MiniR4Digital.h"
11#include <Arduino.h>
12
22template<uint8_t PIN1, uint8_t PIN2> class MiniR4Analog : public MiniR4Digital<PIN1, PIN2>
23{
24public:
26 {
27 _pin1 = PIN1;
28 _pin2 = PIN2;
29 }
30
39 int getAIL(void)
40 {
41 pinMode(_pin1, INPUT);
42 return analogRead(_pin1);
43 }
44
53 int getAIR(void)
54 {
55 pinMode(_pin2, INPUT);
56 return analogRead(_pin2);
57 }
58
59private:
60 uint8_t _pin1;
61 uint8_t _pin2;
62};
63
64#endif // MiniR4Analog_H
Handling MiniR4.Dn digital pin functions.
A class template for handling analog input operations on two specified pins.
int getAIL(void)
Reads the analog value from the first pin.
int getAIR(void)
Reads the analog value from the second pin.
Class for handling digital input and output operations.