Kevin Kent
/
XVHE_HID
IVSC Project
Diff: main.cpp
- Revision:
- 0:960d250e49b2
- Child:
- 1:82f2ef52759e
diff -r 000000000000 -r 960d250e49b2 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 17 23:11:08 2012 +0000 @@ -0,0 +1,27 @@ +#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); + } +}