Snippet - Working with SRF10 Devantech in gadgeteer through extender

Working with SRF10 Devantech in gadgeteer through extender

Hi All,

Here is the tiny little code you could use to hook up ultrasonic sensor SRF10 Devantech and get the distance . I used FEZ spider with extender to connect to SRF10.

Good job. One more advise is to allocate buffers outside the tick handler and reuse them.

hi, i have some basic knowledge on electronic so can you tel me how to connect the sensor using the extender module…(if u have the diagram please post here)

you need to look at the code and the datasheet. This is all stuff that you can reconstruct. The Code says it uses I2C on Socket 10. You can look at the socket definition and see how the pins are connected, then you could look at the SRF10 and map that back to the I2C pins.

Please help me I’m French and when I put your code puts me his "Error 1 The type or namespace name ‘GHI’ not found (a using directive or is an assembly reference missing?) "

Welcome Lucas2a

You didn’t copy the code correctly. The code says “GTI” not GHI - GTI maps back to Gadgeteer.Interfaces in an earlier (4.2 or 4.1) implementation of Gadgeteer, so you need to update that for the 4.3 implementation. The key is that it’s a Gadgeteer I2C object that you need to match up with.