Input

Input include MoonBot Kit Touch Module Infrared Module Controller Module keys and pin mapping module

../../../_images/1.png

Initialization of Touch Sensor

../../../_images/2.png
Introduction

Initialize the touch sensor to the corresponding port.

Introduction
port
  • 1~9

Reading Touch Sensor

../../../_images/3.png
Introduction

Read the value of the corresponding port of the touch sensor

Parameters
port
  • 1~9

Return
  • HIGH :Object Touch Sensor

  • LOW :Objectless Touch Sensor

Initialization of Infrared Sensors

../../../_images/4.png
Introduction

Initialize touch sensor to corresponding port

Parameters
port
  • 1~9

Reading Infrared Sensor

../../../_images/5.png
Introduction

Read the corresponding pin value of infrared sensor port

Parameters
Port
  • 1~9

Pin
  • 1~2

Return
  • HIGH :Infrared Sensor Triggered

  • LOW : Infrared sensor not triggered

Reading Button

../../../_images/6.png
Introduction

Read button status

Parameters
button
  • A :Button A

  • B :Button B

  • A&B:Button A and B

Return
  • HIGH:The Button is pressed

  • LOW:The Button is not pressed

Port pin mapping

../../../_images/7.png
Introduction

Reading the Arduino pin number corresponding to the MoonBot port

Parameters
Port
  • 1~9

Pin
  • 1~2

Return
  • Corresponding Arduino pin