Opposite of "*/" ??
How do I work the */ operator backwards? I have an 8 bit reading from an ADC that I'm adjusting with a multiplier and shifting back out a DAC. I need to get my adjusted value back to an 8 bit number (0-255). This is probably a stupid and obvious solution but I'm stuck.
Thanks,
Code attachedExcerpt ADC issue.bs2
Rob
Thanks,
Code attachedExcerpt ADC issue.bs2
Rob
Comments
Could you please explain a little more what you are trying to do?
Thanks,
Into the DAC, that requires input codes from 0 to 65535. It is best if you scale up so that you can send a full 16 bit quantity to the DAC (but still it will have only 256 steps, which you say is okay).
[B]LOW[/B] latch [COLOR=#999999][COLOR=#000000][B]SHIFTOUT[/B] datain, clock, [B]MSBFIRST[/B], [(O2conc */ 16777) \ 16] [/COLOR]'****new approach[/COLOR] [B]HIGH[/B] latch [B]DEBUG[/B] ? O2conc */ 16777
The math (O2conc */ 16777) will scale up to 65535 when O2conc=1000. Note the \16, which causes the SHIFTOUT to send all 16 bits.
Rob