Adrastos

Member Since: January 5, 2010

Country: Canada

  • Tutorial - Playing WAV Files with a DAC | about 4 years ago

    port manipulation, not “power manipulation” :P

  • Tutorial - Playing WAV Files with a DAC | about 4 years ago

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