the aim of my project, is to build a simple system which takes voice via MIC and translates it into a digital representation zeros and ones. this output then is connected to LEDs . the board i am using is Arduino due.

thank you very much for replying. my aim is establishing a simple telecommunication link between two point using visible light. at the transmitter, voice signal obtained by microphone then translated to digital by ADC and then sent by LEDs ,very much like On-Off Keying modulation. The LEDs work here as an antenna.

at the receiver point, a photo-detector receives the transmitted signal. the transmitted signal then converted to analog by DAC and then fed it to a headset to hear it.

then translated to digital by ADC and then sent by LEDs ,very much like On-Off Keying modulation

If you just use the analogue value to set the brightness you will need a D/A because the PWM period will be too slow. The other problem using amplitude modulation like this is that you need a much bigger signal to prevent it dropping out at low volumes. You could always up the PWM speed to something like 38KHz but that puts a constraint on the speed that the detector has to work at. The difficult part is going to be the receiver. You need to sort out exactly what your hardware is going to be before you worry about code.

"based on my poor understanding" a sequence of digital values that have converted voice signal allows me to use channel coding to detect and fixed some bits at the receiver side which have been damaged in the transmission link.

==========================================================================================As it illustrated in the sketch, i able to see the voice input signal though Serial Monitor window. i stopped here!!! my questions:is there a function that i can use to take the data from analogReadResolution(12) and then connected into one of the digital output? if not, can i see the address i am using to save voice input , because i am thinking i might be able to store the input data after converted by the commend analogReadResolution(12) and then connected to a digital output if it is possible?!!

sorry for the unprofessional description i am very very beginner in embedded circuits,

because of Lack of sufficient time to submit my project, the coding part of my project is excluded from my project.

You misunderstand. Not the code and in the computer instructions but the coding, as in how you are going to take your audio modulation and put it out to light an LED. Without knowing that you can not begin to do anything.

Quote

is there a function that i can use to take the data from analogReadResolution(12) and then connected into one of the digital output?

No but you could connect it to an analogue output. Use the dacc_write_conversion_data() function. Call the analogWriteResolution(12) in setup() first.