![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Code to use read data from MCP3208 ADC via SPI and output it via serial using the LPC1114.
Diff: main.cpp
- Revision:
- 7:983886b6ada9
- Parent:
- 5:9568cfe486dd
diff -r 64bc197574e7 -r 983886b6ada9 main.cpp --- a/main.cpp Fri Dec 02 16:42:51 2016 +0000 +++ b/main.cpp Fri Feb 17 18:15:42 2017 +0000 @@ -2,7 +2,9 @@ #include "mcp3208.h" MCP3208 input1(PA_7, PA_6, PA_5, PA_4); //MCP3208(PinName mosi, PinName miso, PinName clk, PinName cs) -// MCP3208 input1(p5, p6, p7, p8); +//MCP3208 input1(PB_5, PB_4, PB_3, PA_4); + +//MCP3208 input1(p5, p6, p7, p8); //Serial pc(dp16,dp15); // Serial pc(p9,p10); @@ -56,10 +58,10 @@ int tt = 0; t.start(); - pc.baud(9600); + pc.baud(921600); pc.printf("Working!!\n\r"); - datalog.attach_us(&log_data,100000); // 1000us = 1ms + datalog.attach_us(&log_data,1000); // 1000us = 1ms while(1) { intToString(datastr0,input1.binary(0));