![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
IVSC Project
main.cpp
- Committer:
- kevinkent
- Date:
- 2012-05-17
- Revision:
- 0:960d250e49b2
- Child:
- 1:82f2ef52759e
File content as of revision 0:960d250e49b2:
#include "mbed.h" #include "MCP4661.h" DigitalOut myled(LED1); DigitalOut res(LED2); MCP4661 pot1(p28, p27, 0x5c); Serial pc(USBTX,USBRX); int main() { int mid = 0x1; int address = 0x5c; pc.printf("Hello Mbed World\n"); while(1) { myled = 1; wait(0.2); myled = 0; res = pot1.SetValue(0,mid); pc.printf("Val = %d",mid); //data[0] = 0x04; //res = i2c.write(address, data, 1); mid++; wait(1.0); res= 0; wait(1.0); } }