Hi! Guys! I want to design a delay function that can have any desire delay value input in.ex.delay(20)-- 20ms of delay , delay(1000)- 1s of delay. I got problem when I wanted to convert the value of the integer to hexadecimal value. In addition, the hexadecimal value intialize into TH0 and TL0. Give me your advice. Thank You!
I want the user to input the value of their desire delay value. They don't need to convert to hexadecimal value. The function will do it. And i knew about the "0X"or "Ox"
Your problem is how to convert the user input into a hex-number. I think the scanf-function will do this.
Your problem now seems to be multiple personalities: you started as Zidane Fisherman; now you're dawson yeo...! Or is this a team effort?
"Your problem is how to convert the user input into a hex-number." No. The problem is how to convert the user input into a number. Hex is irellevant! He just needs to convert from the user input format (keypresses? thumbwheel switches? ASCII strings from the UART? who knows - he/they didn't say!) to the corresponding int (or whatever) value that his/their 'C' can use in its calculations.