Skip to content

Commit

Permalink
added more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
8rightside committed Mar 7, 2021
1 parent a125f31 commit fac7e1a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//: [Banded Resistor Conversion Inits](@previous)
import Resistance
/*:
# Conversion Functions

The `BandedResistor` types all provide functions for converting to and from each other.
The newly created resistor will have the same `tolerance` value as the resistor it was
converted from.
*/
let fourBand = FourBandResistor(value: 3300, tolerance: .green)
let fiveBand = fourBand.convertToFiveBand()

let greenTolerance = fiveBand.tolerance
/*
When converting to a `SixBandResistor` you can specify a temperature coefficient value
to add to the newly created resistor or a default of `.brown` will be used.
*/
let sixBandDefaultTempCo = fiveBand.convertToSixBand()
let sixBandNewTempCo = fourBand.convertToSixBand(addingCoefficient: .yellow)

let brownTempCo = sixBandDefaultTempCo.coefficient
let yellowTempCo = sixBandNewTempCo.coefficient
//: [ESeriesProtocol](@next)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//: [< Banded Resistor Conversion Inits](@previous)
//: [< Conversion Functions](@previous)
import Resistance
/*:
# ESeriesProtocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [Banded Resistor Round Inits](Banded%20Resistor%20Round%20Inits)
* [Banded Resistor Failable Inits](Banded%20Resistor%20Failable%20Inits)
* [Banded Resistor Conversion Inits](Banded%20Resistor%20Conversion%20Inits)
* [Conversion Functions](Conversion%20Functions)
* [ESeriesProtocol](ESeriesProtocol)
* [ESeries Functions](ESeries%20Functions)
* [Example Uses Case](Example%20Use%20Case)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "file:///Users/matt/Documents/Swift/Frameworks/Resistance/Documentation.playground/Pages/Overview.xcplaygroundpage#CharacterRangeLen=627&amp;CharacterRangeLoc=0&amp;EndingColumnNumber=0&amp;EndingLineNumber=18&amp;StartingColumnNumber=0&amp;StartingLineNumber=0&amp;Timestamp=635979892.2345591"
documentLocation = "file:///Users/matt/Documents/Swift/Frameworks/Resistance/Documentation.playground/Pages/Overview.xcplaygroundpage#CharacterRangeLen=677&amp;CharacterRangeLoc=0&amp;EndingColumnNumber=0&amp;EndingLineNumber=19&amp;StartingColumnNumber=0&amp;StartingLineNumber=0&amp;Timestamp=636768003.247789"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
Expand Down
1 change: 1 addition & 0 deletions Documentation.playground/contents.xcplayground
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<page name='Banded Resistor Round Inits'/>
<page name='Banded Resistor Failable Inits'/>
<page name='Banded Resistor Conversion Inits'/>
<page name='Conversion Functions'/>
<page name='ESeriesProtocol'/>
<page name='ESeries Functions'/>
<page name='Example Use Case'/>
Expand Down

0 comments on commit fac7e1a

Please sign in to comment.