// C++ code
//
int i = 0;
const int ledPin = 13; // select the pin for the LED
// the setup function runs once when you press reset or power the board
const int POTENTIOMETER_PIN = 12; // Arduino pin connected to Potentiometer pin
void setup() {
// initialize digital pin 9 as an output.
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
float val = analogRead(POTENTIOMETER_PIN);
int nilai = val/1023*255;
analogWrite(ledPin,nilai);
Serial.print("\nAnalog : ");
Serial.print(val);
}
FPS: 0
Power: 0.00W
Power: 0.00W