Missed event detector with HM55 compass chip
Steve-0
Posts: 5
I want to write a program for the BS2 using a hitachi HM55 compass chip. I want to monitor movement of a slowly spinning object by polling the compass chip every 30 seconds and noting it's bearing. If the bearing has not changed +/- 5 degrees from the last poll, I one of the I/O pins (say pin 1)to go high. At the same time this is being monitored, I need to monitor another input for change from low to high. When this occurs, I need the same output triggered by the compass (pin 1) to go high. Is this possible with the BS2? Also, once this cycle has completed, I need to reset the whole thing to start over. Any help would be greatly appreciated, I am admittedly new at this programming thing and pretty much self taught.
Comments
It seems possible although there is some missing information. For example, how long does the input stay HIGH for the BASIC Stamp to detect? What is the pulse width? Also, on output HIGH, how long does it stay HIGH before starting over again?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
It’s not as simple as adding a line of code…You never accounted for you input monitoring…I would break the code down to the minimum functional code needed to realize your goals. This code wasn’t written to do what you’re referring to so it may take more time then needed. I don’t even know which file you refer to, but it’s always a good practice to break things down into minimum code when timing is a potential issue.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support