From 93b6260bf9d8404bdfed6f18b84617fd011a4d3a Mon Sep 17 00:00:00 2001 From: Alejandro Diaz Date: Wed, 13 Sep 2023 13:01:49 -0600 Subject: [PATCH] add camera pins --- ui/main/templates/home.html | 4 ++-- ui/main/views.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/main/templates/home.html b/ui/main/templates/home.html index f723ba4..8befc22 100644 --- a/ui/main/templates/home.html +++ b/ui/main/templates/home.html @@ -20,7 +20,7 @@ function take_photo() { $.get("/photo/", function (data) { - + $("#photo").attr("src", "static/photo.jpg?"+d.getTime()); }); } @@ -45,7 +45,7 @@

- My image +
{% else %}
diff --git a/ui/main/views.py b/ui/main/views.py index 7e5c7ec..be8770c 100644 --- a/ui/main/views.py +++ b/ui/main/views.py @@ -26,7 +26,7 @@ def home(request): def take_photo(request): - print("PRINTING PHOTO") + capture_image("/tmp/static/photo.jpg") return HttpResponse("Ok") @@ -50,8 +50,8 @@ def turn_on_all(): def toggle_led(led, turn_on): gpio_pin = leds_gpio[led] if turn_on: - pin_control.turn_on_pin(gpio_pin) - else: pin_control.turn_off_pin(gpio_pin) + else: + pin_control.turn_on_pin(gpio_pin) leds_state[led] = not turn_on return HttpResponse(f"Turn on {led}" if turn_on else f"Turn off {led}") \ No newline at end of file