Sony's LANC camera control protocol project.
Dependencies: aconno_LANC aconno_bsp aconno_SEGGER_RTT
Revision 8:3375dd304db9, committed 2017-11-17
- Comitter:
- jurica238814
- Date:
- Fri Nov 17 11:10:29 2017 +0000
- Parent:
- 6:8cf24e946b0b
- Child:
- 9:978106d4b181
- Commit message:
- Test version with LEDs
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Nov 01 18:05:20 2017 +0000 +++ b/main.cpp Fri Nov 17 11:10:29 2017 +0000 @@ -40,6 +40,7 @@ DigitalOut alive(p23); DigitalOut connectedLED(p24); +DigitalOut testLED(p22); uint8_t normalCommand[MY_BUF_SIZE] __attribute__ ((aligned (32))) = {LANC_L,LANC_L,LANC_L,LANC_H, LANC_H,LANC_L,LANC_L,LANC_L}; uint8_t zoomCommand[MY_BUF_SIZE] __attribute__ ((aligned (32))) = {LANC_L,LANC_L,LANC_L,LANC_H, LANC_L,LANC_H,LANC_L,LANC_L}; @@ -60,7 +61,7 @@ Timer frameTimer; void onConnectionCallback(const Gap::ConnectionCallbackParams_t *params){ - connectedLED = LED_ON; + //connectedLED = LED_ON; ble.gap().stopAdvertising(); } @@ -68,21 +69,24 @@ //newImage[cnt] = params->data[i]; switch(params->data[0]){ case 0x00:{ - sendCommand(normalCmdAddr, startStopAddr); + //sendCommand(normalCmdAddr, startStopAddr); + alive = !alive; + break; } case 0x01:{ - sendCommand(zoomCmdAddr, zoomOutAddr); + //sendCommand(zoomCmdAddr, zoomOutAddr); + connectedLED = !connectedLED; + break; } case 0x02:{ - sendCommand(zoomCmdAddr, zoomInAddr); + //sendCommand(zoomCmdAddr, zoomInAddr); + testLED = !testLED; break; } default: break; } - - return; } @@ -225,7 +229,7 @@ int main(void){ - alive = 0; + alive = LED_OFF; ble.init(bleInitComplete); while (ble.hasInitialized() == false) { /* spin loop */ } @@ -234,7 +238,10 @@ i2sInit(); button.fall(i2sReady); - sendCommand(zoomCmdAddr, zoomInAddr); + //sendCommand(zoomCmdAddr, zoomInAddr); + + connectedLED = LED_OFF; + testLED = LED_OFF; while(1){ ble.waitForEvent();