Telliskivi 2+
Dependencies: CoilGun HumanInterface EthernetInterface ExternalIn LedOut Motor2 PCA9555 QED mbed-rtos mbed PinDetect
Revision 7:a9e98f642a89, committed 2013-11-04
- Comitter:
- mlaane
- Date:
- Mon Nov 04 23:57:09 2013 +0000
- Parent:
- 6:5619aff36840
- Commit message:
- Code cleanup - untested
Changed in this revision
--- a/BallSens.lib Mon Nov 04 21:23:42 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/Reiko/code/BallSens/#962fa32d6675
--- a/CoilGun.lib Mon Nov 04 21:23:42 2013 +0000 +++ b/CoilGun.lib Mon Nov 04 23:57:09 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/Reiko/code/CoilGun/#eee78d8bfdb9 +http://mbed.org/users/Reiko/code/CoilGun/#b663ba6a53fe
--- a/main.cpp Mon Nov 04 21:23:42 2013 +0000 +++ b/main.cpp Mon Nov 04 23:57:09 2013 +0000 @@ -6,7 +6,6 @@ #include "PCA9555.h" #include "motor.h" #include "qed.h" -#include "ballsens.h" #include "ledout.h" #include "externalin.h" #include "coilgun.h" @@ -33,7 +32,6 @@ volatile int update = 0; -volatile int extInChanged = 0; volatile int stallChanged = 0; @@ -83,18 +81,10 @@ update = 1; } -void extChangedCallback() { - extInChanged = 1; -} - void stallChangedCallback() { stallChanged = 1; } -//BallSens ballSens(&ioExt, 10); -//ExternalIn button1(&ioExt, 14); -//ExternalIn button2(&ioExt, 15); - UDPSocket server; Endpoint client; char buffer[256]; @@ -139,7 +129,6 @@ int main (void) { pc.baud(115200); EthernetInterface eth; - //eth.init(); //Use DHCP eth.init("192.168.4.1", "255.255.255.0", "192.168.4.8"); eth.connect(); printf("IP Address is %s\n", eth.getIPAddress()); @@ -193,26 +182,12 @@ //pc.printf("ioExt: %x\n", ioExt.read()); //pc.printf("ioExt: %s\n", byte_to_binary(ioExt.read())); - //ballSens.change(&extChangedCallback); - //button1.change(&extChangedCallback); - //button2.change(&extChangedCallback); - - //humanInterface.change(&extChangedCallback); - motor1.stallChange(&stallChangedCallback); motor2.stallChange(&stallChangedCallback); motor3.stallChange(&stallChangedCallback); motor4.stallChange(&stallChangedCallback); motor5.stallChange(&stallChangedCallback); - //InterruptIn change(p8); - //change.rise(&ballCallBack); - //change.fall(&ballCallBack); - - - //redLed.set(); - //blueLed.set(); - //yellowLed.set(); //int charCount = sprintf(sendBuffer, "<ready>"); //server.sendTo(client, sendBuffer, charCount); @@ -222,14 +197,10 @@ led1 = 1; while (1) { - //coilgun.kick(5000); - //kickFinish.detach(); - //kickFinish.attach_us(&coilgun, &CoilGun::kickEnd, 1000); if (update) { update = 0; ioExt.writePins(); - //coilgun.kick(100); failSafeCount++; if (failSafeCount == failSafeLimit) { @@ -243,7 +214,6 @@ coilgun.discharge(); } if (!coilgun.isCharged) { - //int charCount = sprintf(sendBuffer, "<speeds:%d:%d:%d:%d:%d>"); server.sendTo(client, "<discharged>", 12); } } @@ -303,13 +273,6 @@ if (humanInterface.isStart()) { server.sendTo(client, "<toggle-go>", 11); } - - /*if (extInChanged) { - extInChanged = 0; - bool ballState = humanInterface.getBallState(); - int charCount = sprintf(sendBuffer, "<ioExt:%x>", ioExt.getLastRead()); - server.sendTo(client, sendBuffer, charCount); - }*/ //printf("\nWait for packet...\n");