Below are the pin assignments for use in Arduino sketch followed by those for Micro-python

Arduino Nano pin assignments for programming with Arduino Sketch

The UKMARSBOT robot PCB assigns specific roles to most of the input and output pins. As these are fixed, it is important to use the correct pins for the assigned functions. To help in programming, these pins have been allocated meaningful names as shown below.
Include this section of Sketch code below at the start of your program to make these standard names available for use in your program

// Input pins:
int lside         = A0; // left side sensor input
int rfront        = A1; //front left line sensor input
int lfront        = A2; //front right left sensor input
int rside         = A3; // right side sensor input
int sens1         = A4; // unassigned sensor input 1
int sens2         = A5; // unassigned sensor input 2
int fourwayswitch = A6; // input from function switch
int battery       = A7; // input for battery measurement
int Receive      = 0;  // Receive pin
int Transmit      = 1:  // Transmit pin
int m1encoder1    = 2;  // motor 1 encoder 1 input interrupt pin
int m1encoder2    = 4;  // motor 1 encoder 2 input
int m2encoder1    = 3;  // motor 2 encoder 1 input interrupt pin
int m2encoder2    = 5;  // motor 2 encoder 2 input
// Output pins:
int sensorLED1    = 6;  // 1st diagnostic LED on sensor board
int lmotorDIR     = 7;  // Left motor dirn input 1
int rmotorDIR     = 8;  // Right motor dirn input 3
int lmotorPWM     = 9;  // Left motor PWN pin<br />
int rmotorPWM     = 10; // Right motor PWN pin<br />
int sensorLED2    = 11; // 2nd diagnostic LED on sensor board<br />
int trigger       = 12; // trigger for sensor LEDs<br />
int LED13         = 13; // ext LED Red<br />

In the void setup () section of your program also include the following section of Sketch code:

  pinMode(sensorLED1, OUTPUT);
  pinMode(lmotorDIR, OUTPUT);
  pinMode(rmotorDIR, OUTPUT);
  pinMode(lmotorPWM, OUTPUT);
  pinMode(rmotorPWM, OUTPUT);
  pinMode(sensorLED2, OUTPUT);
  pinMode(trigger, OUTPUT);
  pinMode(LED13, OUTPUT);
  pinMode(m1encoder1, INPUT);
  pinMode(m1encoder2, INPUT);
  pinMode(m2encoder1, INPUT);
  pinMode(m2encoder2, INPUT);

Also include this next line in the void setup() section to allow the serial monitor to work

  Serial.begin(9600);          // set up serial monitor comms on USB

Micro python pin assignments for programming with Thonny

Place these import statements at the beginning of your code:

from machine import Pin, ADC, PWM
import neopixel
import time

# Set pins for digital outputs on Cytron Maker Nano RP2040

LED_PIN = Pin(18, Pin.OUT) # ext LED on GP18
RMOTOR_DIR = Pin(8, Pin.OUT)
LMOTOR_DIR = Pin(7, Pin.OUT)
PIEZO_PIN = Pin(22, Pin.OUT) # Pin connected to piezo buzzer
SENSOR1_PIN = Pin(19, Pin.OUT) # 1st Sensor LED on line follow sensor board
SENSOR2_PIN = Pin(6, Pin.OUT) # 2nd Sensor LED on line follow sensor board
TRIGGER_PIN = Pin(16, Pin.OUT) # Trigger for LEDs on line follow sensor board

# Define PWM motor speed pins

LMOTOR = machine.Pin(9) # left motor is pin 9
MOTOR = machine.Pin(17) # right motor is pin 17
LMOTOR_PWM = machine.PWM(machine.Pin(9))
RMOTOR_PWM = machine.PWM(machine.Pin(17))
LMOTOR_PWM.freq(2000)
RMOTOR_PWM.freq(2000)
LMOTOR_PWM.duty_u16(0) # left motor speed – range is 0 to 65535
RMOTOR_PWM.duty_u16(0) # right motor speed – range is 0 to 65535

# Define analogue inputs used on sensor board

Lsidesense = ADC(Pin(29)) # A3
Lfrontsense = ADC(Pin(28)) # A2
Rfrontsense = ADC(Pin(27)) # A1
Rsidesense = ADC(Pin(26)) # A0

# Define RP2040 on-board button with pull up so it goes false when pressed

btn1 = machine.Pin(20, Pin.IN, Pin.PULL_UP)

# Define press button switch on UKMARS board

Switch = Pin(14, Pin.IN) # button / switch pin

Follow this with your procedure definition and then the code that you want to run when the program starts