digitalRead() and digitalWrite() are respectively used to read and write digital data to the sensors. analogRead() and analogWrite() are respectively used to read and write analog data to the sensors.