arduino mega 2650

Hello,

i´m new to working with arduino and I am trying to read a voltage value on an analog pin (A0) on Arduino mega 2650 Board and output that voltage value to some drivers through an 8 bits number.
Does anyone know how i can do that?

i would really appreciate some help,

thanks.

What have you tried? (Cf the analogRead() function to read a compatible voltage from the ADC)
how the hell should we know what « some drivers » protocol and transport layer are ?

trying to read a voltage value on an analog pin (A0)

The analogRead() function.
Read voltage with analogread().

and output that voltage value to some drivers through an 8 bits number.

PWM with analogWrite().
Convert PWM to analog voltage.

J-M-L:
What have you tried? (Cf the analogRead() function to read a compatible voltage from the ADC)
how the hell should we know what « some drivers » protocol and transport layer are ?

sorry for my mistake, i did not see it, what i want is to see as an output the digital values, but in a 8 bit form.

thanks anyway

groundFungus:
The analogRead() function.
Read voltage with analogread().
PWM with analogWrite().
Convert PWM to analog voltage.

thanks for the help, i'm gonna try it! :slight_smile:

If you want to see a binary (with ASCII 0 and 1) representation of byte b then use Serial.print(b, BIN);