Echelon Neuron C Instrukcja Użytkownika Strona 47

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 268
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 46
Neuron C Programmer’s Guide 35
// since a lower value means more light.
currentBrightness -= input_value;
// Look for underflow or overflow
if (currentBrightness < MAX_BRIGHTNESS)
currentBrightness = MAX_BRIGHTNESS;
else if (currentBrightness > MIN_BRIGHTNESS)
currentBrightness = MIN_BRIGHTNESS;
// Change the triac setting to the
// desired brightness level
io_out(ioLampTriac, currentBrightness);
}
Example 3: Seven-Segment LED Display Interface
The following example shows how to connect multi-character displays to the
neurowire port. The display has an 8-bit configuration register and a 24-bit
display register. This configuration can be defined as follows:
IO_2 output bit ioEnable = 1;
IO_8 neurowire master select(IO_2) ioDisplay;
unsigned char displayReg[3];
unsigned char configReg;
.
.
.
void refreshDisplay() {
__lock {
io_out(ioDisplay, &configReg, 8);
io_out(ioDisplay, displayReg, 24);
}
}
Przeglądanie stron 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 267 268

Komentarze do niniejszej Instrukcji

Brak uwag