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:
- ryood
- Date:
- 2017-06-09
- Revision:
- 0:0e326a52b0f4
- Child:
- 2:492523fce75e
File content as of revision 0:0e326a52b0f4:
#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);
}
}