官术网_书友最值得收藏!

Wiring connection

With a wiring connection, we can connect the LDR sensor module and a LED to the RPi:

The wiring connections are as follows:

  • wiringPi pin 8 of the RPi is connected to the D0 pin of the LDR sensor module
  • Physical pin 2 of the RPi is connected to the Vcc pin of the LDR sensor module
  • Physical pin 6 of the RPi is connected to the Gnd pin of the LDR sensor module
  • wiringPi pin 0 is connected to the positive pin of the LED
  • Physical pin 14 is connected to the negative pin of the LED

Now that we have connected the LDR sensor module and LED to the RPi, let's write the program to turn the LED on/off by taking inputs from the LDR sensor.

主站蜘蛛池模板: 屏东市| 边坝县| 宜兰县| 保亭| 东兴市| 黑河市| 安顺市| 扎兰屯市| 皋兰县| 黑河市| 叙永县| 英超| 苍山县| 独山县| 盐城市| 内江市| 大名县| 民县| 江油市| 临夏市| 巍山| 晋州市| 股票| 沈阳市| 灯塔市| 海城市| 卓资县| 临汾市| 馆陶县| 乌海市| 桐乡市| 武夷山市| 东至县| 武夷山市| 梅河口市| 赤峰市| 奉节县| 南平市| 宁晋县| 漯河市| 平和县|