×

SparkFun Electronics will be closed on July 3rd, 2015 in observance of Independence Day. Any orders placed after 2:00pm MT on July 2nd will be shipped out after the weekend. Thanks!

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 :(