25 if (!
owi.rom_command())
return;
27 const size_t BUF_MAX = 32;
38 switch (
owi.read_command()) {
46 value = digitalRead(pin);
52 digitalWrite(pin, value);
56 value = analogRead(pin);
57 owi.alarm(value > 512);
58 owi.write(&value,
sizeof(value));
63 analogWrite(pin, duty);
66 owi.read(&bp,
sizeof(bp));
71 owi.read(&bp,
sizeof(bp));
73 owi.read(bp, count + 1);
76 owi.read(&bp,
sizeof(bp));
79 while (count--)
owi.write(eeprom_read_byte(bp++));
83 owi.read(&bp,
sizeof(bp));
86 if (count > BUF_MAX) {
87 while (count--)
owi.read();
90 else if (
owi.read(buf, count)) {
91 eeprom_write_block(buf, bp, count);
97 owi.write(NUM_DIGITAL_PINS, 6);
100 owi.write(NUM_ANALOG_INPUTS, 6);
Read digital pin: 6b pin, 1b return.
Software::OWI< BOARD::D7 > owi
static const uint8_t FAMILY_CODE
Get number of analog inputs: 6b return.
Write analog pin: 6b pin, 8b duty.
Set pin mode: 6b pin, 2b mode.
Write digital pin: 6b pin, 1b value.
Get number of digital pins: 6b return.
Read analog pin: 6b pin, 16b+8b return.