PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Distanzmessender Us-sensor an I²C ?!? wie geht das ?



michiE
20.12.2005, 12:28
Ich arbeite bei meinem neuen Projekt erstmals mit distanzmessenden Ultraschallsensoren , und wollte nur kurz fragen , wie man diesen Sensor hier ( http://www.roboter-teile.de/Shop/themes/kategorie/detail.php?artikelid=7&source=2 ) mit ner cc auslesen kann , d.h. was der genau sendet und ob irgend jemand einen kleinen codeschnipsel zum thema auswertung rumliegen hat ... Danke schon mal
(sry , bisher hatte ich nur sensoren mit analoger Ausgangsspannung)

Dirk
23.12.2005, 18:08
Hallo michiE,

die US-Sensoren mit I2C-Ausgang kann man z.B. über einen emulierten I2C-Bus (H.J. Windt: SRF08 RANGE VIA EMULATED I2C BUS) an die CC anschließen. Das ist eine "billige" Lösung, wenn man nicht einen echten Bus für mehrere Sensoren braucht.

Gruß Dirk

Windt H.J.
23.12.2005, 22:39
Hello, sorry for the English,
@ Dirk:
So you find this to be a “cheap solution when you do not need a real bus for more than one sensor”? [-(
My I2C subroutines where carefully written by me to use I2C devices that incorporate I2C clock stretching (The IIC bus on the C-Control I v2.0 does NOT support clock stretching) and you can use these routines to communicate with any 7 bit addressable I2C devices connected to the I2C bus!!
This means that you CAN connect more than 1 I2C device/ sensor and use my I2C subroutines.
The examples provided by me in the download area are for demonstration purposes using the factory set addresses.

@ michiE:
Are you using a C-Control I v1.1 or v2.0?

Greetings,
H.J. Windt

Dirk
24.12.2005, 09:54
Hello H.J.,


So you find this to be a “cheap solution when you do not need a real bus for more than one sensor”?


Oh... I'm sorry! Your routines are perfect and work very well!!!
I should replace the word "billig" by "einfach" (easy to use) what means, that your solution is an easy way to use an I2C sensor on the RP5 without having to write an assembler driver.

I wrote it already when you posted your prog: Very good! \:D/

Greetings Dirk

Windt H.J.
30.12.2005, 13:47
Hello Dirk,
My apologies, I should have realized this!! :oops:
I’m glad you like them.
Greetings,
H.J. Windt

michiE
01.01.2006, 13:33
hey , thanks @all . I used your solution and it fits very well :-)

happy new year and greetings
michi

michiE
13.08.2006, 12:05
ich habe jetzt ewrstmals mehrere Sensoren und auch Aktoren an einem IIC-Bus , und würde gerne den Bus benutzen , der bei der CC auf den Pfostenstecker herausgeführt wurde...
Hat damitjemand erfahrung ???
mfg
Michi

Dirk
13.08.2006, 12:23
Hallo michiE,

die I2C-Pins der CC1 auf dem RP5 kann man nur nutzen, wenn man einen Treiber dafür schreibt, weil das Betriebssystem der CC1 den I2C-Bus nicht unterstützt. Dieser Treiber müßte dann ein Maschinensprache-Treiber sein. Leider belegt ja der RP5-Treiber (p5driv.s19) diesen Platz. Es soll 'mal eine p5driv.s19-Variante (nicht von C !!) gegeben haben, die die I2C-Routinen noch mit enthielt und bei der die RP5-Routinen entsprechend gekürzt waren. Geh 'mal auf die Suche, aber ich habe da auch schon 'mal gesucht: Ohne Erfolg.

Deshalb ist am RP5 am ehesten ein emulierter I2C-Bus angebracht, den du ja auch wohl schon nutzt. Davon kann es auch 2 oder 3 geben.

Gruß Dirk