This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28379D: how to read numbers 12 digital inputs varies from 1 to 100 using LAUNCHXL-F28379D?

Part Number: LAUNCHXL-F28379D

Is it possible to read 12 digital inputs , example the number from 1 to 100 values in define as float or double, As I also want to read decimal points? If decimal points are not possible then how to read integer values? LAUNCHXL-F28379D have enough digital inputs to read 12 inputs but each input varies from 1 to 100? I want to read these values from a MATLAB software, so do I need to convert it to binary or HEX and then use GPIOs to read it? but if convert it to binary it will require  numerus number of GPIOs as binary of 100 is 1100100, so to read 100 in binary required 7 GPIOs, so for 12 digital inputs it may requires 12*7= 84 GPIOs pins. What is the best way to do it? 

  • Hi Adnan,

    Thank you for your question. I am not sure I understand your question properly though.

    If you are wanting a way to read more than just 0/1 from a digital input, that is not possible. It can only ready high/low, you cannot "encode" values into 0 or 1.

    So answering your question, you would need to have a large number of GPIOs to represent the binary.

    If you just want to send a number value, can't you just send a byte in any of the communications formats (SCI, LIN, I2C, CAN, etc.)? Why do you have to use GPIOs to represent a number?

    If this is for a project, I would recommend you instead just use communications. If you have to encode it as multiple pins, then the only way is how you mentioned it, 12*7 = 84 GPIO pins.

    Regards,

    Vince

  • Thank you Vince,

    That's right its not a good idea to use GPIOs as it required a lot and its not available in the board. I was not sure about the other way like  communications formats (SCI, LIN, I2C, CAN, etc) are possible to send number values, I will try to use SCI to send numbers. If there is any example of MATLAB Simulink to use SCI then please let me know.