\ Turn a port pin off, dont change the others. : off ( pinmask portadr -- ) dup ( -- pinmask portadr portadr ) c@ ( -- pinmask portadr value ) rot ( -- portadr value pinmask ) invert and ( -- portadr new-value) swap ( -- new-value port) c! ; \ Only for PORTx bits, \ because address of DDRx is one less than address of PORTx. (ATmega169) \ Set DDRx so its corresponding pin is output. : is_output ( pinmask portadr -- ) 1- on ; \ Set DDRx so its corresponding pin is input. : is_input ( pinmask portadr -- ) 1- off ; \ finis