-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fedingo/MCPS-FridgePI
- Loading branch information
Showing
15 changed files
with
2,544 additions
and
197 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
#!/usr/bin/python | ||
from picamera import PiCamera | ||
from time import sleep | ||
import sys | ||
from sendimage import * | ||
|
||
|
||
ip = sys.argv[1] | ||
dev = sys.argv[2] | ||
|
||
import RPi.GPIO as GPIO | ||
import time | ||
|
||
GPIO.setmode(GPIO.BOARD) | ||
GPIO.setup(7,GPIO.IN) | ||
GPIO.setup(31,GPIO.OUT) | ||
GPIO.output(31,0) | ||
camera = PiCamera() | ||
|
||
while True: | ||
while GPIO.input(7) != 0: | ||
if GPIO.input(7) == 0: | ||
GPIO.output(31,1) | ||
time.sleep(3) | ||
|
||
camera.start_preview() | ||
sleep(3) | ||
camera.capture('./image.jpg') | ||
camera.stop_preview() | ||
|
||
print('immagine fatta') | ||
sleep(3) | ||
|
||
print('invio immagine') | ||
send(ip,dev) | ||
print('immagine inviata') | ||
GPIO.output(31,0) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import requests | ||
|
||
|
||
def send(ip, dev): | ||
url = 'http://'+str(ip)+'/sendImage' | ||
files = {'image': open('image.jpg', 'rb'), 'device': dev} | ||
requests.post(url, files=files) | ||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.