Ignore:
Timestamp:
Apr 30, 2016, 11:29:25 PM (8 years ago)
Author:
ertl-honda
Message:

1.7.10のファイルに更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/arduino_lib/libraries/Firmata/examples/OldStandardFirmata/OldStandardFirmata.ino

    r136 r224  
    5656void outputPort(byte portNumber, byte portValue)
    5757{
    58   portValue = portValue &~ portStatus[portNumber];
     58  portValue = portValue & ~ portStatus[portNumber];
    5959  if (previousPINs[portNumber] != portValue) {
    6060    Firmata.sendDigitalPort(portNumber, portValue);
     
    7373    if (reportPINs[i]) {
    7474      switch (i) {
    75         case 0: outputPort(0, PIND &~ B00000011); break; // ignore Rx/Tx 0/1
     75        case 0: outputPort(0, PIND & ~ B00000011); break; // ignore Rx/Tx 0/1
    7676        case 1: outputPort(1, PINB); break;
    7777        case 2: outputPort(2, PINC); break;
     
    105105      case INPUT:
    106106        pinMode(pin, INPUT);
    107         portStatus[port] = portStatus[port] &~ (1 << (pin - offset));
     107        portStatus[port] = portStatus[port] & ~ (1 << (pin - offset));
    108108        break;
    109109      case OUTPUT:
     
    113113        portStatus[port] = portStatus[port] | (1 << (pin - offset));
    114114        break;
    115         //case ANALOG: // TODO figure this out
     115      //case ANALOG: // TODO figure this out
    116116      default:
    117117        Firmata.sendString("");
     
    123123void analogWriteCallback(byte pin, int value)
    124124{
    125   setPinModeCallback(pin, PWM);
     125  setPinModeCallback(pin, PIN_MODE_PWM);
    126126  analogWrite(pin, value);
    127127}
     
    132132    case 0: // pins 2-7 (don't change Rx/Tx, pins 0 and 1)
    133133      // 0xFF03 == B1111111100000011    0x03 == B00000011
    134       PORTD = (value &~ 0xFF03) | (PORTD & 0x03);
     134      PORTD = (value & ~ 0xFF03) | (PORTD & 0x03);
    135135      break;
    136136    case 1: // pins 8-13 (14,15 are disabled for the crystal)
     
    151151{
    152152  if (value == 0) {
    153     analogInputsToReport = analogInputsToReport &~ (1 << pin);
     153    analogInputsToReport = analogInputsToReport & ~ (1 << pin);
    154154  }
    155155  else { // everything but 0 enables reporting of that pin
     
    203203   * host computer, since once in the loop(), this firmware will only send
    204204   * digital data on change. */
    205   if (reportPINs[0]) outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1
     205  if (reportPINs[0]) outputPort(0, PIND & ~ B00000011); // ignore Rx/Tx 0/1
    206206  if (reportPINs[1]) outputPort(1, PINB);
    207207  if (reportPINs[2]) outputPort(2, PINC);
Note: See TracChangeset for help on using the changeset viewer.