This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with switches

Hi guys, I am Alvin, I got some problem with handling switches that are embedded in micro controller. I saw the sample program, it says that if the switch is being press then it is "0" if not it is "1". So I added the blinking code inside the if loop, if its a 0, it will light up if not it wont like up.

If(SW2==0){
//light up LED
}

IF(SW1==0){
//Dont light up LED
}

Something like this.

Also, If I want to read data from USB port, so which part should i look for in the header section? Is it the I/O hexadecimal or other special hexadecimal?

thank You Very Much!

Parents
  • Since you haven't said what specific microcontroller you're using, it is impossible to say - they are all different!

    The operation of the USB port will be described in the Documentation for the specific microcontroller - you have to study that to find out how to use it!

    And check the manufacturer's website for application notes, examples, etc,...

    Also the Documentation for the specific development board.

Reply
  • Since you haven't said what specific microcontroller you're using, it is impossible to say - they are all different!

    The operation of the USB port will be described in the Documentation for the specific microcontroller - you have to study that to find out how to use it!

    And check the manufacturer's website for application notes, examples, etc,...

    Also the Documentation for the specific development board.

Children