This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| de:software:homelab:library:pin [2010/10/29 13:09] – Wember | de:software:homelab:library:pin [2020/07/20 12:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Pins ====== | ====== Pins ====== | ||
| - | Pins Bibliothek | + | Die Pins-Bibliothek |
| - | Der Benutzer | + | |
| - | ===== Data types ===== | + | ===== Datentypen |
| - | * **// | + | * **//pin//** Datentyp für Adressen |
| - | Um das effizienteste Programm zu bekommen | + | |
| ===== Funktionen ===== | ===== Funktionen ===== | ||
| * **//void pin_setup_output(pin pin)//** \\ | * **//void pin_setup_output(pin pin)//** \\ | ||
| - | Konfiguriert Pin als Output. Parameter: | + | Konfiguriert |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_setup_input(pin pin)//** \\ | * **//void pin_setup_input(pin pin)//** \\ | ||
| - | Konfiguriert Pin als Input ohne Pull-up Widerstand. Parameter: | + | Konfiguriert |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_setup_input_with_pullup(pin pin)//** \\ | * **//void pin_setup_input_with_pullup(pin pin)//** \\ | ||
| - | Konfiguriert Pin als Input mit Pull-up Widerstand. Parameter: | + | Konfiguriert |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_set(pin pin)//** \\ | * **//void pin_set(pin pin)//** \\ | ||
| - | Setzt Output Pin high. Parameter: | + | Setzt einen Output-Pin high. Parameter: |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_clear(pin pin)//** \\ | * **//void pin_clear(pin pin)//** \\ | ||
| - | Setzt Output Pin low. Parameter: | + | Setzt einen Output-Pin low. Parameter: |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_toggle(pin pin)//** \\ | * **//void pin_toggle(pin pin)//** \\ | ||
| - | Invertiert Output | + | Invertiert |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| * **//void pin_set_to(pin pin, bool value)//** \\ | * **//void pin_set_to(pin pin, bool value)//** \\ | ||
| - | Setzt Output Pin zum gewünschten Zustand. Parameter: | + | Setzt einen Output-Pin in den gewünschten Zustand. Parameter: |
| * //pin// - Pin Variable. | * //pin// - Pin Variable. | ||
| - | * //value// - Desired state boolean value. | + | * //value// - Gewünschter Status als Bool' |
| * **//bool pin_get_value(pin pin)//** \\ | * **//bool pin_get_value(pin pin)//** \\ | ||
| - | Holt Pinwert. Parameter: | + | Holt Pin-Wert. Parameter: |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| - | * Return boolean | + | * Gibt Bool' |
| * **//bool pin_get_debounced_value(pin pin)//** \\ | * **//bool pin_get_debounced_value(pin pin)//** \\ | ||
| - | Liest den Pinwert durch den Switch-Debounce-Filter. | + | Liest den Pinwert durch den Switch-Debounce-Filter. |
| - | * //pin// - Pin variable. | + | * //pin// - Pin Variable. |
| - | * Return pin boolean value - // | + | * Gibt dem Pin den Bool' |
| ===== Beispiel ===== | ===== Beispiel ===== | ||
| - | Beispiel um einen Pinwert | + | Beispiel um einen Pin-Wert |
| Line 60: | Line 58: | ||
| pin_setup_output(output_pin); | pin_setup_output(output_pin); | ||
| - | // Konfiguriert Pin als Input Pin mit Pull-up | + | // Konfiguriert Pin als Input-Pin mit Pull-up |
| pin_setup_input_with_pullup(input_pin); | pin_setup_input_with_pullup(input_pin); | ||
| Line 66: | Line 64: | ||
| while (true) | while (true) | ||
| { | { | ||
| - | // Getting an input pin value | + | // Wert eines Input-Pins erhalten |
| value = pin_get_value(input_pin); | value = pin_get_value(input_pin); | ||
| - | // Setting an output pin value | + | // Wert für den Output-Pin setzen |
| pin_set_to(output_pin, | pin_set_to(output_pin, | ||
| } | } | ||
| } | } | ||
| </ | </ | ||