//Fork a simulation process which will get char typed into the simulation terminal and transmit them on the simulation uartPinfork{uartPin#=truewhile(true){//System.in is the java equivalent of the C stdinif(System.in.available()!=0){valbuffer=System.in.read()uartPin#=falsesleep(baudPeriod)for(bitId<-0to7){uartPin#=((buffer>>bitId)&1)!=0sleep(baudPeriod)}uartPin#=truesleep(baudPeriod)}else{sleep(baudPeriod*10)//Sleep a little while to avoid pulling System.in to often}}}