Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add position sensor block #6

Open
araobp opened this issue Sep 26, 2017 · 2 comments
Open

Add position sensor block #6

araobp opened this issue Sep 26, 2017 · 2 comments

Comments

@araobp
Copy link
Owner

araobp commented Sep 26, 2017

Use hall sensors to detect movement of a thing with a small magnet.

  • Out => In: 1
  • In => Out: 0

If the number of hall sensors is 6:

%21:UINT8_T:0,0,1,0,0,0,0,0
%21:UINT8_T:0,0,0,1,0,0,0,0
%21:UINT8_T:0,0,0,0,1,0,0,0

This block does not generate time-series data. See also #5.

@araobp
Copy link
Owner Author

araobp commented Oct 5, 2017

This commit 7ec68ee for PIC16F1825.

@araobp
Copy link
Owner Author

araobp commented Oct 5, 2017

The implementation for PIC16F1829 requires a bug fix:

   for(i=0; i<AINS; i++) {
        if ((value & mask) == 0) {  <== this is the bug.
            analog_in[i] = 0;
            position[i] = 0;
        } else {
            analog_in[i] = ANALOG_IN[i];
        }
        mask = mask << 1;
    }

@araobp araobp added the bug label Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant