Help with homework problem decimal to hex conversion on arduino uno

Delete

He has provided hints in the exact places you need to enter the two correct lines of code.

The whole point of YOUR homework is that YOU are supposed to work it out. Presumably the proceeding lessons were designed to give you the knowledge to complete the task.

Asking someone else on the internet to solve it for you is an old fashioned thing that people of my generation know as 'cheating'.

If I understand your assignment, you only need to add two lines of code?

//convert character input to number
      //CODE LINE MISSING HERE
      //HINT: Convert input to an integer and store in the number field

I think you just have to convert a number that's in the form of a string, to an integer. You can look-up the function to do that.

For example, in a string the ([u]ASCII[/u] encoded) letter 'A' is represented by 61 (decimal). The the character representing the number '1' is not the value one, it's represented by 49 (decimal).

//display the result
 //CODE LINE MISSING HERE
 //HINT: Call to updateDisplay to show the result

It looks like you just have to call the function. Do you know how to call a function and pass a couple of values into the function?

@DVDdoug 61?... = =

For example, in a string the (ASCII encoded) letter 'A' is represented by 61 65 (decimal).

??

Doc

Sharkbiteattack:
So I have this homework assignement I'm really struggling on. I have a double 7 digit LED display (88) and I have to make it display the hex equivalent of a number 0-255. Here's the code, there are some code segments missing that need to be filled in to make the program work and I'm stuck. The instructor has given me 2 hints //HINT: Call to updateDisplay to show the result and //HINT: Convert input to an integer and store in the number field Any help would be appreciated.

Which one of these are you stuck on, and what have you tried so far to solve the problem yourself?

For what it's worth, your instructor has introduced a subtle bug by failing to null-terminate the input string so once you have worked out (or Googled) how to convert a string to a number you will find it doesn't work until you append the null terminator. Personally, I'd recommend appending it after every character is added. (No - I'm not going to tell you how to do that; if you've been set this problem you must be expected to know enough to recognise the concepts and if you don't, ten seconds with Google would explain them to you.)