Skip to content

Commit d1fff4c

Browse files
authored
Update cbcore.ts
Added back the RC time block with a slightly better description
1 parent 5da16fc commit d1fff4c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cbcore.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,19 @@ namespace cyberbot {
400400
return z;
401401
}
402402

403+
/**
404+
* Measure the time it takes for a connected capacitor to charge/discharge (1/0) through a resistor.
405+
* @param pin The desired pin
406+
* @param s The settings for the sensor. Time to charge is 1 and time to discharge is 0.
407+
*/
408+
//% blockId="cyberbot_rc_time" block="RC time %s on pin %pin"
409+
//% group="Sensors"
410+
//% weight=345
411+
export function rcTime(s: number, pin: BotPin): number {
412+
sendCommand(pin, null, RCTIME, s, null, null);
413+
return read_r();
414+
}
415+
403416
/**
404417
* Send out a Pulse on the desired pin.
405418
* @param pin The desired pin.

0 commit comments

Comments
 (0)