Skip to content

Commit

Permalink
Added "tentative" WS2813 timings
Browse files Browse the repository at this point in the history
  • Loading branch information
uraimo committed Apr 8, 2017
1 parent 75d7006 commit a7ee924
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![WS281x](https://github.com/uraimo/WS281x.swift/raw/master/logo.png)

*A Swift library for WS2812x/NeoPixel (WS2811,WS2812,WS2812B) RGB led strips, rings, sticks, matrices, etc...*
*A Swift library for WS2812x/NeoPixel (WS2811,WS2812,WS2812B,WS2813) RGB led strips, rings, sticks, matrices, etc...*

<p>
<img src="https://img.shields.io/badge/os-linux-green.svg?style=flat" alt="Linux-only" />
Expand Down
11 changes: 7 additions & 4 deletions Sources/WS281x.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,21 @@ public class WS281x{
}

public enum WSKind{
case WS2812B //T0H:0.35us T0L:0.9us, T1H:0.9us T1L:0.35us , resDelay > 50us
case WS2812 //T0H:0.35us T0L:0.8us, T1H:0.7us T1L:0.6us , resDelay > 50us
case WS2811 //T0H:0.5us T0L:2.0us, T1H:1.2us T1L:1.3us , resDelay > 50us
case WS2812 //T0H:0.35us T0L:0.8us, T1H:0.7us T1L:0.6us , resDelay > 50us
case WS2812B //T0H:0.35us T0L:0.9us, T1H:0.9us T1L:0.35us , resDelay > 50us
case WS2813 //T0H:0.35us T0L:0.9us, T1H:0.9us T1L:0.35us , resDelay > 250us ?

public func getDuty() -> (zero:Int,one:Int,frequency:Int,resetDelay:Int){
switch self{
case WSKind.WS2812B:
case WSKind.WS2811:
return (33,66,800_000,55)
case WSKind.WS2812:
return (33,66,800_000,55)
case WSKind.WS2811:
case WSKind.WS2812B:
return (33,66,800_000,55)
case WSKind.WS2813:
return (33,66,800_000,255)
}
}
}
Expand Down
Binary file added docs/WS2813.pdf
Binary file not shown.

0 comments on commit a7ee924

Please sign in to comment.