Shop OBEX P1 Docs P2 Docs Learn Events
useing COUNT on multi lines — Parallax Forums

useing COUNT on multi lines

KC8DKTKC8DKT Posts: 76
edited 2006-06-22 14:38 in BASIC Stamp
·· What would be the best way to go about·COUNTing·5 RPM lines?·· I use the·MCP23016 I2C I/O expander right now.· I used the INT·on the MCP with a pulldown going to stamp Pin7.· This works and only uses 1 pin but there has to be a better way.

This is some of the test code
I know I can walk through each pin with the < and some vars for 1·small loop but for now I am just looking for a diff/better way to do this.· Starting to think the MCP230xx is not the best way.
RPMCheck:
'***************************************************************************
  I2COUT SDA, %01000000, GP0, [noparse][[/noparse]%00000000,%10000000]
  I2COUT SDA, %01000000, IODIR1, [noparse][[/noparse]%10000000]
  COUNT 7, 910, RPM1
  SEROUT LCDO, 396,[noparse][[/noparse]254,71,17,3,"FAN1"]
  SEROUT LCDO, 396,[noparse][[/noparse]254,71,17,4,DEC2 RPM1]
'***************************************************************************
  I2COUT SDA, %01000000, GP0, [noparse][[/noparse]%00000000,%01000000]
  I2COUT SDA, %01000000, IODIR1, [noparse][[/noparse]%01000000]
  COUNT 7, 910, RPM2
  SEROUT LCDO, 396,[noparse][[/noparse]254,71,17,3,"FAN2"]
  SEROUT LCDO, 396,[noparse][[/noparse]254,71,17,4,DEC2 RPM2]
'***************************************************************************

return

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-06-22 14:38
    Please, how about more information on what you're trying to do. In particular, do you want to count RPMs simultaneously on all 5 pins or one at a time? What kind of speeds are we looking at (RPMs)? Why did you decide to use an I/O expander? Is there some reason why you're not tying the sensors to the Stamp itself?
Sign In or Register to comment.