IGGE Power board
Dependencies: mbed ADS1015 USBDevice MCP4725
Diff: main.cpp
- Revision:
- 3:a01ea06ca9ab
- Parent:
- 2:321c8783ea30
- Child:
- 4:d29a7b77b1c6
--- a/main.cpp Wed Mar 26 03:36:02 2014 +0000 +++ b/main.cpp Tue Apr 01 14:47:21 2014 +0000 @@ -36,8 +36,8 @@ DigitalOut relSens(p21); DigitalOut relUsr(p22); DigitalOut relNet(p23); +DigitalOut relCpuRst(p24); DigitalOut relCpuPower(p25); -DigitalOut relCpuRst(p24); //30 minute graph arrays @@ -114,13 +114,16 @@ iPeriArr[i] =iPeriArr[i-1]; } iPeriArr[0]= iPeri.read_u16(); + led0= !led0; } void setup(void) { graph.attach(&updateArray, 10); //update array every 10 seconds - + cantbus.frequency(500000); + CANMessage can_MsgRx; + //initialize relays relSens= 0; relNet =0; @@ -135,6 +138,17 @@ int main() { setup(); + + graph.attach(updateArray, 1); //update array every 10 seconds + cantbus.frequency(500000); + CANMessage can_MsgRx; + + //initialize relays + relSens= 0; + relNet =0; + relCpuPower=0; + relCpuRst =0; + relUsr=0; while (1) { @@ -143,11 +157,7 @@ pc.printf("reading: %d\r\n", vFive); // print reading pc.printf("reading: %d\r\n", vMot); // print reading - wait(2); // loop 2 sek - led0 = 1; - wait(0.2); - led0 = 0; - wait(0.2); + wait(2); } }