Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PBO595_h
- #define PBO595_h 001 // software version of this library.
- #define BUS_OUTPUT
- #ifdef ARDUINO && ARDUINO >= 100
- #include "Arduino.h"
- #else
- #include "WProgram.h"
- #endif
- #ifndef DATA_SIZE
- #define DATA_SIZE uint8_t
- #endif
- #include <ParallelBus.h>
- // Default control pins.
- #define PIN_CS 10
- #define PIN_CLOCK 13
- #define PIN_DATA_OUT 11
- #define PIN_LATCH 8
- class PBO595 : public ParallelBus {
- public:
- // Contructors.
- PBO595();
- PBO595(uint8_t pinCS, uint8_t pinClock, uint8_t pinLatch, uint8_t pinData);
- // Public methods.
- void begin();
- DATA_SIZE read();
- void write(DATA_SIZE value);
- private:
- // Private methods.
- void init(uint8_t pinCS, uint8_t pinClock, uint8_t pinLatch, uint8_t pinData);
- // Private attributes.
- // Demux 74595 connections.
- uint8_t _pinCS;
- uint8_t _pinClock;
- uint8_t _pinLatch;
- uint8_t _pinData;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment