How to Program the Bottom IR Sensors on the Inventor Board

first, begin the code by assigning the Bottom IR Sensor Pins(11-18) as inputs. Enter the following inside the  void setup()

Now we will setup the serial monitor baud rate. This is so we may see the state (1 or 0) of each IR sensor.

Now type into the void loop()  the following.

So whats going on is that we are going to display the state of the IR sensors from pins 11-18 and print it onto the serial monitor. The delay is to avoid having data coming out too fast to be read.

Quick note the pins 14 and 15 are connected to the same IR sensor on the bottom. You will also note that the top blue LEDs and the bottom IR sensor share the same pin numbers, this is because they share the same pins, so you may not be able to control the LED and IR sensor simultaneously.

You are now done with coding, just upload this code and open up the serial monitor and you can view which IR sensors are being activated. Try to aim the board at the sun to the see if it triggers the sensors.

Here is the Final code.