Skip to content
2 changes: 1 addition & 1 deletion examples/neopixel/grbw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import colorsys
import math
Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/half.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pantilthat

Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/max.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pantilthat

Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/neopixels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import colorsys
import math
Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/off.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pantilthat

Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/setall.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys
from sys import argv
Expand Down
2 changes: 1 addition & 1 deletion examples/neopixel/white.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pantilthat

Expand Down
2 changes: 1 addition & 1 deletion examples/pantiltweb/pantiltweb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import pantilthat
from sys import exit
Expand Down
4 changes: 2 additions & 2 deletions examples/pantiltweb/templates/gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ <h1>Pan Tilt HAT: Web Interface</h1>
switch(e.keyCode){
case 38: // Arrow Up
current_direction = 'tilt';
current_angle = 1;
current_angle = -1;
interval = setInterval(pantilt,pantilt_speed);
break;
case 40: // Arrow Down
current_direction = 'tilt';
current_angle = -1;
current_angle = 1;
interval = setInterval(pantilt,pantilt_speed);
break;
case 37: // Arrow Left
Expand Down
2 changes: 1 addition & 1 deletion examples/smooth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import math
import time
Expand Down
2 changes: 1 addition & 1 deletion examples/timeout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import time

Expand Down
6 changes: 6 additions & 0 deletions neopixel-blinkt/blinkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
_clear_on_exit = True
_brightness = 0.2
NUM_PIXELS = 8
pixels = [[0, 0, 0, _brightness]] * NUM_PIXELS

def _exit():
if _clear_on_exit:
Expand All @@ -28,6 +29,7 @@ def set_brightness(brightness):


def clear():
pixels[:] = [[0, 0, 0, _brightness]] * NUM_PIXELS
pantilthat.clear()


Expand All @@ -39,13 +41,17 @@ def set_all(r, g, b, brightness=None):
global _brightness
if brightness is not None:
_brightness = brightness
pixels[:] = [[r, g, b, _brightness]] * NUM_PIXELS
pantilthat.set_all(int(r*_brightness), int(g*_brightness), int(b*_brightness))

def get_pixel(x):
return pixels[0]

def set_pixel(x, r, g, b, brightness=None):
global _brightness
if brightness is not None:
_brightness = brightness
pixels[x] = [r, g, b, _brightness]
pantilthat.set_pixel(x, int(r*_brightness), int(g*_brightness), int(b*_brightness))


Expand Down
2 changes: 1 addition & 1 deletion neopixel-blinkt/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

"""
Copyright (c) 2016 Pimoroni.
Expand Down