Code Monkey home page Code Monkey logo

Comments (14)

xuchen avatar xuchen commented on August 23, 2024 4

yes; i'm going offline now, good luck!

from snowboy.

xuchen avatar xuchen commented on August 23, 2024 3

something like this?

pin_x = Light(17)

callbacks = [pin_x.set_on, pin_x.set_off]
print('Listening... Press Ctrl+C to exit')

# main loop
# make sure you have the same numbers of callbacks and models
detector.start(detected_callback=callbacks,
               interrupt_check=interrupt_callback,
               sleep_time=0.03)

from snowboy.

xuchen avatar xuchen commented on August 23, 2024 1

This is really not a snowboy issue but related to Raspberry Pi. Did you have a look at the example we gave about GPIO:

http://docs.kitt.ai/snowboy/#blink-an-led-light

from snowboy.

xuchen avatar xuchen commented on August 23, 2024 1

check out:

https://docs.python.org/2/library/subprocess.html

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

I did but as i mentioned i want on-off script i.e. if model 1 detected it should be turn on gpio pin x and if model 2 detected it should turn off the relay pin.

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

@xuchen Thank you Very much.. I really appreciate your work...

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

Another script request ...can you please tell me how to execute custom bash script which works exactly like this.
(i'm making home automation project ( school project)). i want to add functionality like if i say "update" it should execute linux command like "sudo apt-get update"

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

I'm sorry, i'm new to python can you describe where to implement this subprocess call.. in the line callbacks?

from snowboy.

xuchen avatar xuchen commented on August 23, 2024

you gotta first spend time to learn python then handling snowboy is just a piece of cake. how about starting from here: https://docs.python.org/2.7/tutorial/index.html

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

well i don't have much time.. submission is near.. can you please tell me the how to implement it.. i tried it but got an error. check logs here--> http://goo.gl/3ud1pb

from snowboy.

xuchen avatar xuchen commented on August 23, 2024

from beginning: import subprocess

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

Got an error command specified in subprocess executes at script runtime see log here.. http://goo.gl/KeKL7X

from snowboy.

xuchen avatar xuchen commented on August 23, 2024

you should wrap your callback in a lambda function:

callbacks = [lambda: subprocess.check_call(["ls", "-l"])]

from snowboy.

jaydevs avatar jaydevs commented on August 23, 2024

so everything in subprocess " " will execute right... also other python scripts?

from snowboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.