![]() The other 4 pins on the sensor can be added later on if desired. These 4 pins allow us to power the sensor and communicate over I2C. For now, the only pins we care about are Vdd (supply voltage), Gnd (ground), SCL (serial clock line), and SDA (serial data line). Once the pins have been soldered, the next step is to create a cable to connect the sensor pins to either the Rev module or the Modern Robotics Device Interface Module. For those with less experience, the important things to remember are to make sure the pins are electrically connected to the PCB, and that solder is not shorting any of the pins to one another. ![]() For those who are experienced with soldering, this will be simple. Once you receive the sensor, the header pins need to be soldered onto the chip. Adafruit’s PCB includes pull-up/down resistors for some of the pins for the user, so there’s no need for you to add them. The sensor itself if actually the small black chip in the middle of the PCB with 8 pins coming out of the sides. The sensor can be found on Adafruit’s website: Īdafruit sells the sensor chip connected to a PCB along with a pin header. While the practical use of this sensor may be limited for FTC use, it’s an example of a simple I2C sensor that will act as a guide to creating other I2C devices. Extend I2CDeviceSynch class and add required methodsįor the purpose of giving instruction on how to create an I2C driver, this document shows the process to create a driver for Adafruit’s MCP9808 temperature sensor.Wire and connect to I2C port on Rev module or Modern Robotics Device Interface Module.The rest of this document goes into thorough detail of each step. Many will have these supplies in their own workshops, or can be purchased from hobby shops.īelow is a basic outline of the process involved with getting an I2C sensor up and running. You’ll need to physically connect the device to an I2C port, which will often require soldering of header pins to the sensor, and creating appropriate connectors.Wires, connectors, headers, soldering station, etc. ![]() These are generally found on the seller’s website, and can often be found from a Google search. Datasheets provide all of the information you’ll need to use the sensor, and a lot of other potentially useful information.Many are available from 3rd party sellers like Adafruit.Fortunately, the FTC SDK has made it rather simple to create an I2C device driver. Analog and digital sensors are easy to program, but creating a driver for an I2C device can be very involved. The FTC SDK comes with built in support for many external sensors, but teams may find a sensor that they want to use that is not supported by the SDK. The source code files used in this document can be found at the following link: He is an alumnus of the FIRST Tech Challenge and FTC Team 8923 (Swerve Robotics, Perpetual Velocity) from Woodinville, WA. This document was written by Andryw Wade, who was the FIRST Tech Challenge summer engineering intern for 2017. This is and advanced topic and requires knowledge of advanced programming concepts. This tutorial describes how to integrate an off-the-shelf, I2C sensor into the FIRST Tech Challenge Android control system. The FIRST Tech Challenge software development kit (SDK) also lets advanced users write their own software driver to integrate an I2C device with the FTC Robot Controller app. The FIRST Tech Challenge software has built-in support for several commercially available sensors. I2C (which can be pronounced as either "I squared C" or "I two C") is a type of low cost serial bus that is commonly used to connect peripheral electronic devices, such as a sensor, to a microcontroller (such as the REV Robotics Expansion Hub). A revised document with updated instructions on how to write an I2C driver will post posted soon to replace this version. This article refers to a deprecated approach to writing a driver.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |