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.
main.cpp
- Committer:
- allanw
- Date:
- 2012-01-16
- Revision:
- 0:d308aef39cfa
- Child:
- 1:14c0250ab954
File content as of revision 0:d308aef39cfa:
#include "mbed.h"
SPI spi(p11, p12, p13);
DigitalOut latchpin(p10);
void latch() {
latchpin = 1;
latchpin = 1;
latchpin = 1;
latchpin = 1;
latchpin = 1;
latchpin = 1;
latchpin = 0;
}
int main() {
spi.format(12, 0);
spi.frequency(16 * 1000 * 1000);
latchpin = 0;
while (1) {
for (int i = 0; i < 100; i++) {
spi.write(0);
}
latch();
}
}