Skip to content

Commit

Permalink
Added asl namespace to AslAnalogMultiplexer library
Browse files Browse the repository at this point in the history
  • Loading branch information
j54n1n committed Apr 4, 2017
1 parent a26de6d commit caf6f0c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A library to interface with analog multiplexers. Supports 4051, 4052, 4053, and

## How to use
```
#include <AnalogMultiplexer.h>
#include <AslAnalogMultiplexer.h>
enum {
PIN_EN = 2, // The enable pin of the multiplexer or NOT_A_PIN.
Expand All @@ -14,6 +14,8 @@ enum {
PIN_IO = A0 // Use here a pin that can work in analog & digital modes.
};
using namespace asl;
AMxx4051 mux{ PIN_EN, PIN_S0, PIN_S1, PIN_S2 }; // 8:1 Multiplexer.
void setup() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <AnalogMultiplexer.h>
#include <AslAnalogMultiplexer.h>

// Selected Arduino pins.
enum {
Expand All @@ -10,6 +10,8 @@ enum {
PIN_IO = A0 // Use here a pin that can work in analog & digital modes.
};

using namespace asl;

AMxx4067 mux{ PIN_EN, PIN_S0, PIN_S1, PIN_S2, PIN_S3 }; // 16:1 Multiplexer.
// Other possible types are:
//AMxx4051 mux{ PIN_EN, PIN_S0, PIN_S1, PIN_S2 }; // 8:1 Multiplexer.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=AnalogMultiplexer
version=1.0.1
name=AslAnalogMultiplexer
version=1.0.2
author=Julian Sanin <[email protected]>
maintainer=Julian Sanin <[email protected]>
sentence=A library to interface with analog multiplexers.
paragraph=Supports 4051, 4052, 4053, and 4067 series multiplexers.
category=Uncategorized
url=https://github.com/j54n1n/arduinorobot
architectures=avr
url=https://github.com/j54n1n/arduino-libraries
architectures=*
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
* THE SOFTWARE.
*/

#include "AnalogMultiplexer.h"
#include "AslAnalogMultiplexer.h"

namespace asl {

AnalogMultiplexer::AnalogMultiplexer(uint8_t pinEnable) {
_pinEnable = pinEnable;
Expand Down Expand Up @@ -74,3 +76,5 @@ int AnalogMultiplexer::analogRead(uint8_t channel) {
}
return 0;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
* THE SOFTWARE.
*/

#ifndef ANALOG_MULTIPLEXER_H
#define ANALOG_MULTIPLEXER_H
#ifndef ASL_ANALOG_MULTIPLEXER_H
#define ASL_ANALOG_MULTIPLEXER_H

#include <Arduino.h>

namespace asl {

/// <summary>CMOS Logic Analog Multiplexer and Demultiplexer.</summary>
class AnalogMultiplexer {

Expand Down Expand Up @@ -164,4 +166,6 @@ using AMxx4053 = AMxx40xx<uint8_t>;
/// </summary>
using AMxx4067 = AMxx40xx<uint8_t, uint8_t, uint8_t, uint8_t>;

#endif //ANALOG_MULTIPLEXER
}

#endif //ASL_ANALOG_MULTIPLEXER_H

0 comments on commit caf6f0c

Please sign in to comment.