Jump to content

Search the Community

Showing results for tags '#switch debouncing'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 1 result

  1. Hi all, I'm relatively new to microcontroller programming and I'm having a few problems with a current project that I would appreciate help with. I'm using MSP430G2553 and Energia to control the speed of two vibromotors. To this I use three pushbuttons, one to change from one motor to another and two more(up and down) to increase/decrease the speed. I have 3 interrupts to do all this and I copied the code below. The program works mostly but sometimes it acts randomly, for example, increasing the speed when I press the decrease button, or not responding at all. My questions are these, they are quite simple but I am struggling quite a lot and I want to understand the basics good: 1). Am I using the interrupts correctly? Do I need to put all of them in the setup routine? Also, I have too much code in the interrupt functions, but not sure how to fix this. Should I just poll the flags in the functions and do the motor speed updating in the loop routine? Basically, and help and comments regarding the interrupts would be very helpful. 2). How do I use switch debouncing for more then one switch? I used the Energia example previously to debounce one switch but it seems complicated using that for 3 switches. int reading = digitalRead(buttonPin); if (reading != lastButtonState) { lastDebounceTime = millis(); } if ((millis( ) - lastDebounceTime) > debounceDelay) { buttonState = reading; } My current code: up_down_test.ino Thank you a lot in advance!
  • Create New...