Echelon Neuron C Manual do Utilizador Página 47

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 268
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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);
}
}
Vista de página 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 267 268

Comentários a estes Manuais

Sem comentários