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.
Diff: main.cpp
- Revision:
- 1:14c0250ab954
- Parent:
- 0:d308aef39cfa
--- a/main.cpp Mon Jan 16 21:10:27 2012 +0000
+++ b/main.cpp Mon Jan 16 21:16:23 2012 +0000
@@ -1,27 +1,16 @@
-#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();
- }
+#include "mbed.h"
+
+SPI spi(p11, p12, p13);
+DigitalOut latchpin(p10);
+
+int main() {
+ spi.format(8, 0);
+ spi.frequency(16 * 1000 * 1000);
+
+ latchpin = 0;
+ while (1) {
+ latchpin = 1;
+ spi.write(0);
+ latchpin = 0;
+ }
}
\ No newline at end of file