For the first time, I have used UNO R3.
Using sample and modifying it, I connected analogout pin 9 to analogy A0.
Confirming the out voltage has my willingness, but, analog data is not almost 0 and max 1023.
Why?
Please show me the resolution method.
Best regards
Hiroyasu Matsuda___________________________________
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to
int sensorValue=0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(analogInPin);
outputValue++;
analogWrite(analogOutPin, outputValue);
Serial.print("sensor = ");
Serial.print(sensorValue);
Serial.print("\t output = ");
Serial.println(outputValue);
delay(100);
if( outputValue>256){ outputValue=0;}