diff --git a/README.md b/README.md index 95241bc..67d822c 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Pino led(13, Pino::Mode::out); // select the pin for the LED void setup() {} void loop() { - int sensorValue = sensor.read(); + auto sensorValue = sensor.read(); led.on(); // stop the program for milliseconds: delay(sensorValue); - led.off();; + led.off(); // stop the program for for milliseconds: delay(sensorValue); } @@ -113,7 +113,7 @@ The table below shows the corresponding class methods to native functions: | `pin.shiftIn(clockPin)` |`shiftIn(pin, clockPin, MSBFIRST)`| | `pin.shiftInRe(clockPin)` |`shiftIn(pin, clockPin, LSBFIRST)`| -More details see [surce code](Pino.h) +More details see [surce code](src/Pino.h) ![Pino](/extras/Pino.png?raw=true) diff --git a/src/Pino.h b/src/Pino.h index fc041fd..4cc49c6 100644 --- a/src/Pino.h +++ b/src/Pino.h @@ -98,7 +98,8 @@ class Pino ::tone(_pin, frequency, duration); } - // Stops the generation of a square wave triggered by tone(). Has no effect if no tone is being generated. + // Stops the generation of a square wave triggered by tone(). + // Has no effect if no tone is being generated. void noTone() const { ::noTone(_pin); @@ -107,21 +108,21 @@ class Pino // Reads a pulse HIGH on the pin. uint32_t pulseInOn(uint32_t timeout) const { - return pulseIn(_pin, HIGH, timeout); + return ::pulseIn(_pin, HIGH, timeout); } uint32_t pulseInOn() const { - return pulseIn(_pin, HIGH); + return ::pulseIn(_pin, HIGH); } - // // Reads a pulse HIGH on the pin. + // Reads a pulse HIGH on the pin. uint32_t pulseInOff(uint32_t timeout) const { - return pulseIn(_pin, LOW, timeout); + return ::pulseIn(_pin, LOW, timeout); } uint32_t pulseInOff() const { - return pulseIn(_pin, LOW); + return ::pulseIn(_pin, LOW); } // Shifts out a byte of data one bit at a time @@ -166,6 +167,7 @@ class Pino return ::shiftIn(_pin, clockPin._pin, LSBFIRST); } + // Cast to a number operator uint8_t () const { return _pin;