programming a integrated encoder

Hello I’m Kahl, and I have been recently building a robot but I am having troubles programming. I am using robotc and have a vex edr robot. I am trying to use a integrated encoder but once again I have no clue how to program it. I have two encoders I am trying to program on a remote control program. What I am asking from you is if you could please let me see a sample program for my current situation. Thank you very much.

Assign the encoder to a motor in the Motors&Sensors setup dialog.

you can read the value of the encoder using the nMotorEncoder] intrinsic, lets say you have assigned it to motor port1, then you would read and assign it to a variable like this.

int x;
x = nMotorEncoder port1 ];