(Practice 1) Checking Button Values

circle-info

(Practice 1) To check the button values, you need to understand the concepts of [Serial Monitor] and [Infinite Loop].

Example Code

(Example) Checking Button Values through the Serial Monitor

(Result)

  • [When the button is pressed]: 0

  • [When the button is not pressed]: 1


๐Ÿ”” Block Explanation

  1. [Print (Enter text input [] ) to serial monitor] Block

  • This block is used to output a desired string or value to the serial monitor.

[Print (Enter text input [] ) to serial monitor] Block
[Print ( ) to serial monitor] Block
  1. [Get Button's Value] Block

  • This block is used to read the current button status of the AI camera.

[Get Button's Value] Block

(Additional) How to Check Serial Monitor

How to Open the Serial Monitor

You can open the Serial Monitor window by clicking the monitor icon at the bottom right.

When you open the window, you can see the current button value displayed every 0.5 seconds. (It shows 0 when the button is pressed, and 1 when it is not pressed.)

Last updated