digitalRead()

Reads the value from a specified digital pin, either HIGH or LOW. Check Z-Uno pinout digitalRead(pin) pin the number of the digital pin you want to read HIGH or LOW If pin is not in INPUT or INPUT_PULLUP mode, automatically changes pin mode to INPUT as pinMode(pin, INPUT) was called.
void setup() {
  pinMode(13, OUTPUT);      // sets the digital pin 13 as output
  pinMode(7, INPUT);        // sets the digital pin 7 as input
}

void loop() {
  BYTE val;
  
  val = digitalRead(7);     // read the input pin
  digitalWrite(13, val);    // sets the LED to the button's value
}
Z-Uno pin control is pretty slow, typical digitalRead() call will take itself about 1 ms. Fast operations are allowed in special special "fast mode". To use this fast mode one need to specify pin number via s_pin variable type. Z-Uno compiler will detect it and use fast mode for such digitalRead() calls. In this case the call will take about 1–2 μs for indirect call (via function) and 0.5 μs for direct (see example below). By default pins 9-16 are fast. You can change this using ZUNO_REMAP_SPINS()
s_pin my_pin = 9;

void setup() {
  pinMode(my_pin, INPUT);
}

// timeout and return are in loop periods = 10 us + execution time of digitalRead + time of loop and compatison operands execution
// it should be measured on a particular version of Z-Uno s/w (might change from version to version)
int readPulseLength(s_pin pin, int timeoutCount) {
  int __timeoutCount;
  pinMode(pin, INPUT);

  __timeoutCount = timeoutCount;
  while(digitalRead(pin) != HIGH && timeoutCount-- > 0) {
    // wait for HIGH state (pulse start) or timeout
    delayMicroseconds(10);
  }
  if (timeoutCount == 0) return -1;

  __timeoutCount = timeoutCount;
  while(digitalRead(pin) != LOW && timeoutCount-- > 0) {
    // wait for LOW state (pulse end) or timeout
    delayMicroseconds(10);
  }
  if (timeoutCount == 0) return -1;
  else return timeoutCount * 10;
}

void loop() {
  byte another_pin;
  int length;

  byte result = digitalRead(my_pin);       // direct call is possible
    
  another_pin = 10;
  length = readPulseLength(another_pin);   // or call via function
}