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:
- 0:0e326a52b0f4
- Child:
- 2:492523fce75e
diff -r 000000000000 -r 0e326a52b0f4 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jun 09 03:59:35 2017 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+#include "mcp3008.h"
+
+int main()
+{
+ SPI spiM(SPI_MOSI, SPI_MISO, SPI_SCK);
+ spiM.frequency(1000000);
+ MCP3008 mcp3008_0(spiM, D10);
+
+ float v0[8];
+
+ for (;;) {
+ for (int i = 0; i < 8; i++) {
+ v0[i] = mcp3008_0.read_input(i);
+ }
+
+ printf("Device0\t");
+ for (int i = 0; i < 8; i++) {
+ printf("%.3f\t", v0[i]);
+ }
+ printf("\r\n");
+
+ wait(0.2);
+ }
+}
+
\ No newline at end of file