First code for incremental sensor