Servo library support (#1343)

* ateempt at bringin servos

* basic plumbing

* avoid math map duplicate

* missing parts annontation

* pretify parts

* extend appcompat layer

* updated strings

* more compat layer

* annotations

* don't rely on webmidi

* updated pxt ref

* bump pxt

* adding whenUsed

* updated v1 readme

* more pins

* more pins

* compress the parts definition

* update common packages
This commit is contained in:
Peli de Halleux
2018-10-05 11:09:08 -07:00
committed by GitHub
parent fd954ed6f8
commit 9002edbb22
15 changed files with 333 additions and 43 deletions

View File

@ -13,7 +13,7 @@ namespace pins {
* @param toHigh the upper bound of the value's target range, eg: 4
*/
//% help=pins/map weight=23
//% blockId=math_map block="map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh"
//% blockId=pin_map block="map %value|from low %fromLow|from high %fromHigh|to low %toLow|to high %toHigh"
export function map(value: number, fromLow: number, fromHigh: number, toLow: number, toHigh: number): number {
return ((value - fromLow) * (toHigh - toLow)) / (fromHigh - fromLow) + toLow;
}