Skip to content

Commit

Permalink
Update cbcore.ts
Browse files Browse the repository at this point in the history
Added back the RC time block with a slightly better description
  • Loading branch information
WeirdowlOI authored Jan 8, 2025
1 parent 5da16fc commit d1fff4c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cbcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ namespace cyberbot {
return z;
}

/**
* Measure the time it takes for a connected capacitor to charge/discharge (1/0) through a resistor.
* @param pin The desired pin
* @param s The settings for the sensor. Time to charge is 1 and time to discharge is 0.
*/
//% blockId="cyberbot_rc_time" block="RC time %s on pin %pin"
//% group="Sensors"
//% weight=345
export function rcTime(s: number, pin: BotPin): number {
sendCommand(pin, null, RCTIME, s, null, null);
return read_r();
}

/**
* Send out a Pulse on the desired pin.
* @param pin The desired pin.
Expand Down

0 comments on commit d1fff4c

Please sign in to comment.