Opposite of "*/" ??
Turnbull2112
Posts: 65
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).
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