×

SparkFun Electronics will be closed in observance of memorial day on Monday, May 29th. We will resume normal business hours on Tuesday, May 30th. Any orders placed after 2pm Mountain Time on Friday, May 26th will process and ship out on Tuesday, May 30th.

Adrastos

Member Since: January 5, 2010

Country: Canada

  • port manipulation, not “power manipulation” :P

  • Note that you don’t need to migrate the entire project into C to take advantage of direct power manipulation, you can do that straight in the Arduino code (without doing digitalWrites). Just make sure to add the sbi and cbi macros in the sketch:

    define sbi(var, mask) ((var) |= (uint8_t)(1 << mask))

    define cbi(var, mask) ((var) &= (uint8_t)~(1 << mask))

    void setup()
    {
    sbi(PORTC, 5);
    cbi(PORTC, 5);
    PORTD = 42;
    }
    etc… The Arduino functions just make sure you don’t screw yourself if you don’t know what you’re doing, or for just plain ease of use.

No public wish lists :(