File: takePic.c

package info (click to toggle)
gphoto 0.3.5-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,636 kB
  • ctags: 1,973
  • sloc: ansic: 23,035; sh: 4,851; makefile: 175
file content (46 lines) | stat: -rw-r--r-- 984 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "defs.h"
#include "transmission.h"

void qm100_takePic(int serialdev)
{
  unsigned char cmd_setpic[QM100_SETPIC_LEN]=QM100_SETPIC;
  unsigned char cmd_takepic[QM100_TAKEPIC_LEN]=QM100_TAKEPIC;
  qm100_packet_block packet;
  
  /* Set Quality */

  cmd_setpic[4]=0x00;
  cmd_setpic[5]=0x80;
  cmd_setpic[6]=QUALITY_FINE;
  packet = qm100_transmit(serialdev, cmd_setpic, sizeof(cmd_setpic));

  /* Set Flash */

  cmd_setpic[4]=0x00;
  cmd_setpic[5]=0x90;
  cmd_setpic[6]=FLASH_AUTO;
  packet = qm100_transmit(serialdev, cmd_setpic, sizeof(cmd_setpic));

  /* Set Exposure */

  cmd_setpic[4]=0x02;
  cmd_setpic[5]=0x80;
  cmd_setpic[6]=0x00;
  packet = qm100_transmit(serialdev, cmd_setpic, sizeof(cmd_setpic));

  /* Set Focus */

  cmd_setpic[4]=0x02;
  cmd_setpic[5]=0x90;
  cmd_setpic[6]=FOCUS_AUTO;
  packet = qm100_transmit(serialdev, cmd_setpic, sizeof(cmd_setpic));

  /* Take Picture */

  packet = qm100_transmit(serialdev, cmd_takepic, sizeof(cmd_takepic));

}