Skip to main content

Component

Every component (Display, Motor, Speaker, etc.) has the functions listed here, on top of its own.


Functions​

getId​

Component.getId()

Gets the unique ID of the component. This is the ID of the shape the component is built on, so it stays the same while the component exists.

Returns:

  • [ integer ] The ID of the component.

Notes​

info

Calling any function on a component that is no longer connected to a computer (or anything else) throws a Cannot find component! error. Fetch the components again with the sc.get... functions if you get this.