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 [crayon-670b2842974f8296282657-i/]
[crayon-670b2842974ff478684740/]
Now we will setup the serial monitor baud rate. This is so we may see the state (1 or 0) of each IR sensor.
[crayon-670b284297500012620778/]
Now type into the [crayon-670b284297502395988362-i/] the following.
[crayon-670b284297503336863463/]
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.
[crayon-670b284297505710047653/]