Skip to content

Commit

Permalink
added examples directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jirhiker committed Apr 24, 2018
1 parent 9fbbf52 commit 8db0a69
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ===============================================================================
# Copyright 2015 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================

# ============= enthought library imports =======================
# ============= standard library imports ========================
# ============= local library imports ==========================


# ============= EOF =============================================



42 changes: 42 additions & 0 deletions examples/capture_loop.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ===============================================================================
# Copyright 2018 ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================
import time

from camera import ToupCamCamera


def main():

cam = ToupCamCamera()
cam.open()

# wait for camera to startup
time.sleep(2)

# capture n images
n = 10
# every t seconds
t = 2

for i in xrange(n):
path = 'test_image-{:02d}.jpg'.format(i)
cam.save(path)
time.sleep(t)


if __name__ == '__main__':
main()
# ============= EOF =============================================

0 comments on commit 8db0a69

Please sign in to comment.