This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Read Analog Voltage from Potentiometer

Hi Keil Users,

Good day.

I'm trying to read analog voltage from potentiometer and show the value in Keil.
I tried to use adruino and it works.

Can anyone convert below arduino command to Keil?
I'm using Nuvoton NUC131SD2AE and multi function shield.

Arduino Command:

#define Pot1 0

void setup()
{
Serial.begin(9600);
}

/* Main Program */
void loop()
{

Serial.print("P_reading: ");
Serial.println(analogRead(Pot1));
/* Wait 0.5 seconds before reading again */
delay(500);
}

Thank you.