Skip to content

Instantly share code, notes, and snippets.

@proto-pic
Created November 17, 2016 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proto-pic/c3dd7ad00e58bc2f1e85ddd92f3ac222 to your computer and use it in GitHub Desktop.
Save proto-pic/c3dd7ad00e58bc2f1e85ddd92f3ac222 to your computer and use it in GitHub Desktop.
from microbit import *
import neopixel
np = neopixel.NeoPixel(pin0, 32)
while True:
tmp = pin1.read_analog()
temp = ((tmp * (3300.0/1024.0))-500.0)/10.0
display.scroll(str(temp))
tempcolour = int((temp * 3.6))
for pix in range (0,32):
np[pix] = (tempcolour,0,(255-(tempcolour*2)))
np.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment