-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdebug_information.py
More file actions
56 lines (43 loc) · 1.21 KB
/
debug_information.py
File metadata and controls
56 lines (43 loc) · 1.21 KB
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
47
48
49
50
51
52
53
54
55
56
'''
Demonstrating the `debug_text_enabled=True` argument in the Camera initialisation
'''
from machine import Pin, SPI
from camera import *
'''
#################### PINOUT ####################
Camera pin - Pico Pin
VCC - 3V3 - red
GND - GND - black
SPI - 0
SCK - GP18 - white
MISO - RX - GP16 - brown
MOSI - TX - GP19 - yellow
CS - GP17 - orange
Camera pin - ESP32 S3
VCC - 3V3 - red
GND - GND - black
SPI - 2
SCK - GP12 - white
MISO - RX - GP13 - brown
MOSI - TX - GP11 - yellow
CS - GP17 - orange
'''
spi = SPI(0,sck=Pin(18), miso=Pin(16), mosi=Pin(19), baudrate=7000000)
cs = Pin(17, Pin.OUT)
onboard_LED = Pin(15, Pin.OUT)
cam = Camera(spi, cs, debug_text_enabled=True)
cam.resolution = '320X240'
cam.resolution
start_time_capture = utime.ticks_ms()
onboard_LED.on()
cam.capture_jpg()
sleep_ms(200)
cam.save_jpg('image.jpg')
onboard_LED.off()
total_time_ms = utime.ticks_diff(utime.ticks_ms(), start_time_capture)
print('Time taken: {}s'.format(total_time_ms/1000))
'''
Benchmarks
- Default SPI speed (1000000?), cam.resolution = '640X480', no burst read (camera pointed at roof) ==== TIME: ~7.8 seconds
- Increased speed (8000000), cam.resolution = '640X480', no burst read (camera pointed at roof) ==== TIME: ~7.3 seconds
'''