SPCR values into string
i spcr values displayed on screen fine command below, couldn't copy them string variable (that should possibly contain leading zero(s)).
serial.print(spcr, bin);
kind of feel dumb ask - advice appreciated.
serial.print(spcr, bin);
kind of feel dumb ask - advice appreciated.
may it's better formulate question in different way.
we know spi settings determined arduino spi control register (spcr).
the question is:
how can read out values each of specifc bits , store each of them different variable?
in spi these bits are:
spie, spe, dord, mstr, cpol, cpha, spr1, spr0
i'd values displayed on screen , put string-variables named like:
v_spie, v_spe, v_dord, v_mstr, v_cpol, v_cpha, v-spr1, v_spr0.
displaying values of spcr on screen not problem, except leading zero's omitted. command [font=courier]serial.print(spcr,bin);[/font]
how can avoid leading zero's?
how can read each bit separately?
help , advice appreciated.
thanks.
we know spi settings determined arduino spi control register (spcr).
the question is:
how can read out values each of specifc bits , store each of them different variable?
in spi these bits are:
spie, spe, dord, mstr, cpol, cpha, spr1, spr0
i'd values displayed on screen , put string-variables named like:
v_spie, v_spe, v_dord, v_mstr, v_cpol, v_cpha, v-spr1, v_spr0.
displaying values of spcr on screen not problem, except leading zero's omitted. command [font=courier]serial.print(spcr,bin);[/font]
how can avoid leading zero's?
how can read each bit separately?
help , advice appreciated.
thanks.
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > SPCR values into string
arduino
Comments
Post a Comment