Skip to content

Commit

Permalink
Update pics and add check for divide by zero
Browse files Browse the repository at this point in the history
  • Loading branch information
kusti8 committed Jul 6, 2017
1 parent bccfee5 commit 98ec282
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Support me on patreon: https://www.patreon.com/kusti8

A **cross-platform** driver in Python for the NZXT Hue+. Supports **all functionality** except FPS, CPU, and GPU lighting.

![Fixed](https://github.com/kusti8/hue-plus/raw/master/fixed.png)
![Custom](https://github.com/kusti8/hue-plus/raw/master/custom.png)
![Windows](https://github.com/kusti8/hue-plus/raw/master/windows.png)
![Profile](https://github.com/kusti8/hue-plus/raw/master/profile.png)
## Install
### Windows
There is always an easy exe installer available here:
Expand Down
Binary file added custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion hue_plus/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ def audio_level(ser, gui, channel, colors, tolerance, smooth):
value = int(math.sqrt(summ / 1470.0) / 10)
amps.append(value - delta)
summ = 0
tarW=float(amps[0]*1.0/delta/100)
if delta == 0:
tarW=0.0
else:
tarW=float(amps[0]*1.0/delta/100)
s.append(tarW)
if len(s) >= smooth:
out = sum(s)/len(s)
Expand Down
Binary file added output.wav
Binary file not shown.
Binary file added profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 98ec282

Please sign in to comment.