Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 1620_App_Board_Shift_Register 1620_App_Board_UART_getc 1620_Project_Template 1620_Project_Template ... more
ShiftReg.h@1:33b34e0ed72c, 2017-02-20 (annotated)
- Committer:
- eencae
- Date:
- Mon Feb 20 20:38:39 2017 +0000
- Revision:
- 1:33b34e0ed72c
- Parent:
- 0:4922f5f8bfa9
Test change
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| eencae | 0:4922f5f8bfa9 | 1 | #ifndef SHIFTREG_H |
| eencae | 0:4922f5f8bfa9 | 2 | #define SHIFTREG_H |
| eencae | 0:4922f5f8bfa9 | 3 | |
| eencae | 0:4922f5f8bfa9 | 4 | #include <mbed.h> |
| eencae | 0:4922f5f8bfa9 | 5 | |
| eencae | 0:4922f5f8bfa9 | 6 | /** A simple serial driver for a shift register that uses only three digital out pins. |
| eencae | 0:4922f5f8bfa9 | 7 | * Based on a fork of Ollie8/ShiftOut |
| eencae | 0:4922f5f8bfa9 | 8 | */ |
| eencae | 0:4922f5f8bfa9 | 9 | class ShiftReg { |
| eencae | 0:4922f5f8bfa9 | 10 | |
| eencae | 0:4922f5f8bfa9 | 11 | public : |
| eencae | 0:4922f5f8bfa9 | 12 | |
| eencae | 0:4922f5f8bfa9 | 13 | ShiftReg(); |
| eencae | 0:4922f5f8bfa9 | 14 | ~ShiftReg(); |
| eencae | 0:4922f5f8bfa9 | 15 | void write(int data); |
| eencae | 0:4922f5f8bfa9 | 16 | |
| eencae | 0:4922f5f8bfa9 | 17 | private : |
| eencae | 0:4922f5f8bfa9 | 18 | DigitalOut *clkout; |
| eencae | 0:4922f5f8bfa9 | 19 | DigitalOut *dataout; |
| eencae | 0:4922f5f8bfa9 | 20 | DigitalOut *latchout; |
| eencae | 0:4922f5f8bfa9 | 21 | }; |
| eencae | 0:4922f5f8bfa9 | 22 | |
| eencae | 1:33b34e0ed72c | 23 | #endif |
| eencae | 1:33b34e0ed72c | 24 | |
| eencae | 1:33b34e0ed72c | 25 | // test!! |