hello,
I am trying to write an 8-bit number to a register of programmable sound generator.
Low four bits are used for frequency and higher four bits are used for volume.
Frequency and volume should be independly controlled by potentiometers connected to arduinos
analog inputs.
So, after reading value I will get number between 0-15 from each potentiometer.
Can you help me how can I write them to my 8-bit number please?
for ex:
volume = analogRead(A0) >> 6;
frequency = analogRead(A1) >> 6;
if frequency will be for ex. 10 and volume will be 8 then writing to register should look like this
myRegisterWrite(regNum, B10001010);
am I right?
how the code of writing should be please?
Thank you.