Anschluss von Incremental-Encodern
|
23.11.2007, 08:08
Beitrag #2
|
|||
|
|||
RE: Anschluss von Incremental-Encodern
Hallo, Timmi,
in IC4 gibt es im Manual einen Hinweis auf die Nutzung der Encoder. -------------------------------------------------- The four encoder channels use digital ports 7, 8, 12, and 13: Encoder channel 0 is labeled port 7 on your Handyboard (you cannot use encoder 0 if you are using the sonar) Encoder channel 1 is labeled port 8 Encoder channel 2 is labeled port 12 Encoder channel 3 is labeled port 13 Encoder functions: Remember that all encoder functions use the encoder channel number, not the digital port number which is labeled on the Handyboard. The encoder channel is a number between 0 and 3. enable_encoder(encoderchannel #); This function enables an encoder channel. At the beginning of your program, you should call enable_encoder once for each encoder you plan to use. disable_encoder(encoder#); This function disables an encoder channel. Normally there is no reason to call disable_encoder. read_encoder(encoder#); Returns the number of transitions. Each transition counts (both 0 to 1 and 1 to 0). reset_encoder(encoder#); Sets that encoder’s count to zero Encoder technical details Encoder channels 0 and 1 are "hardware" encoders, and can count very quickly. Some sensors, especially mechanical pushbuttons, have multiple transitions all at the same time (this is sometimes called "bounce"). The hardware encoders can count all the bounces. Encoder channels 2 and 3 are "software" encoders, and are sampled 1000 times per second. They are less sensitive to bounce than the hardware encoders. Because these channels are implemented in software, enabling them will cause your program to run slower. ------------------------------------------------- Die Anschlüsse für die Encoder sind Port: 7,8 und 12, 13 Wichtig sind diese Funktionen: enable_encoder(Encodernummer); Schaltet den Encoder ein. Encodernummer teilt sich so auf: 0 = Port 7 1 = Port 8 2 = Port 12 3 = Port 13 disable_encoder(Encodernummer); Schaltet die Encoderfunktion wieder ab. read_encoder(Encodernummer); Gibt die Anzahl der Schaltungen am Encoderport. reset_encoder(Encodernummer); Setzt den Zählwert der read-Funktion auf Null zurück. Hilft das weiter? Grüße |
|||
|
Nachrichten in diesem Thema |
Anschluss von Incremental-Encodern - Timmi - 23.11.2007, 08:04
RE: Anschluss von Incremental-Encodern - Manfred - 23.11.2007 08:08
|
Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste