ce3383f1b7
* Turn ratio field editor (initial draft) * Add field turn ratio editor * Fix arrow rotation * Fix left and right direction, remove unnecessary SVG circles. * Update UI a little. add marker. * updated math for turnratio angle * slightly cuter * cleanup * consistent naming * more cleanup * fixing motor node issue * updated package version
25 lines
770 B
TypeScript
25 lines
770 B
TypeScript
|
|
namespace motors {
|
|
|
|
/**
|
|
* A speed picker
|
|
* @param speed the speed, eg: 50
|
|
*/
|
|
//% blockId=motorSpeedPicker block="%speed" shim=TD_ID
|
|
//% speed.fieldEditor="speed" colorSecondary="#FFFFFF"
|
|
//% weight=0 blockHidden=1 speed.fieldOptions.decompileLiterals=1
|
|
export function __speedPicker(speed: number): number {
|
|
return speed;
|
|
}
|
|
|
|
/**
|
|
* A turn ratio picker
|
|
* @param turnratio the turn ratio, eg: 0
|
|
*/
|
|
//% blockId=motorTurnRatioPicker block="%turnratio" shim=TD_ID
|
|
//% turnratio.fieldEditor="turnratio" colorSecondary="#FFFFFF"
|
|
//% weight=0 blockHidden=1 turnRatio.fieldOptions.decompileLiterals=1
|
|
export function __turnRatioPicker(turnratio: number): number {
|
|
return turnratio;
|
|
}
|
|
} |