Skip to content

Commit fb30aec

Browse files
committed
Updating examples.
1 parent 80d14f8 commit fb30aec

File tree

3 files changed

+33
-98
lines changed

3 files changed

+33
-98
lines changed

examples/vc0706_snapshot_computer.py renamed to examples/vc0706_snapshot_filesystem.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
1-
# VC0706 image capture to local storage.
2-
# You must wire up the VC0706 to a USB or hardware serial port.
3-
# Primarily for use with Linux/Raspberry Pi but also can work with Mac/Windows
1+
"""VC0706 image capture to local storage.
2+
You must wire up the VC0706 to a USB or hardware serial port.
3+
Primarily for use with Linux/Raspberry Pi but also can work with Mac/Windows"""
44

55
import time
6-
import serial
6+
import busio
7+
import board
78
import adafruit_vc0706
89

9-
# Configuration:
10-
IMAGE_FILE = 'image.jpg' # Full path to file name to save captured image.
11-
# Will overwrite!
10+
# Set this to the full path to the file name to save the captured image. WILL OVERWRITE!
11+
# CircuitPython internal filesystem configuration:
12+
IMAGE_FILE = '/image.jpg'
13+
# USB to serial adapter configuration:
14+
# IMAGE_FILE = 'image.jpg' # Full path to file name to save captured image. Will overwrite!
15+
# Raspberry Pi configuration:
16+
# IMAGE_FILE = '/home/pi/image.jpg' # Full path to file name to save image. Will overwrite!
1217

13-
# Create a serial connection for the VC0706 connection, speed is auto-detected.
18+
19+
# Create a serial connection for the VC0706 connection.
20+
uart = busio.UART(board.TX, board.RX, baudrate=115200, timeout=0.25)
1421
# Update the serial port name to match the serial connection for the camera!
15-
uart = serial.Serial("/dev/ttyUSB0", timeout=0.25)
22+
# For use with USB to serial adapter:
23+
# import serial
24+
# uart = serial.Serial("/dev/ttyUSB0", baudrate=115200, timeout=0.25)
25+
# For use with Raspberry Pi:
26+
# import serial
27+
# uart = serial.Serial("/dev/ttyS0", baudrate=115200, timeout=0.25)
1628

1729
# Setup VC0706 camera
1830
vc0706 = adafruit_vc0706.VC0706(uart)
@@ -21,12 +33,10 @@
2133
print('VC0706 version:')
2234
print(vc0706.version)
2335

24-
# Set the baud rate to 115200 for fastest transfer (its the max speed)
25-
vc0706.baudrate = 115200
26-
2736
# Set the image size.
28-
vc0706.image_size = adafruit_vc0706.IMAGE_SIZE_640x480 # Or set IMAGE_SIZE_320x240 or
29-
# IMAGE_SIZE_160x120
37+
vc0706.image_size = adafruit_vc0706.IMAGE_SIZE_640x480
38+
# Or set IMAGE_SIZE_320x240 or IMAGE_SIZE_160x120
39+
3040
# Note you can also read the property and compare against those values to
3141
# see the current size:
3242
size = vc0706.image_size

examples/vc0706_snapshot_internal.py

Lines changed: 0 additions & 76 deletions
This file was deleted.

examples/vc0706_snapshot_simpletest.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# VC0706 image capture to SD card demo.
2-
# You must wire up the VC0706 to the board's serial port, and a SD card holder
3-
# to the board's SPI bus. Use the Feather M0 Adalogger as it includes a SD
4-
# card holder pre-wired to the board--this sketch is setup to use the Adalogger!
5-
# In addition you MUST also install the following dependent SD card library:
6-
# https://github.com/adafruit/Adafruit_CircuitPython_SD
7-
# See the guide here for more details on using SD cards with CircuitPython:
8-
# https://learn.adafruit.com/micropython-hardware-sd-cards
1+
"""VC0706 image capture to SD card demo.
2+
You must wire up the VC0706 to the board's serial port, and a SD card holder
3+
to the board's SPI bus. Use the Feather M0 Adalogger as it includes a SD
4+
card holder pre-wired to the board--this sketch is setup to use the Adalogger!
5+
In addition you MUST also install the following dependent SD card library:
6+
https://github.com/adafruit/Adafruit_CircuitPython_SD
7+
See the guide here for more details on using SD cards with CircuitPython:
8+
https://learn.adafruit.com/micropython-hardware-sd-cards"""
9+
910
import time
1011

1112
import board

0 commit comments

Comments
 (0)