Mac 67 Posted January 27, 2011 Share Posted January 27, 2011 I'll assume you need some rest (grin), and I apologize if I made you feel a little defensive. That was not my intention Sir. Hopefully, someone gleaned some insight into the use of a switch state latch and parallel switch state logic (a worthy subject by itself). Take care. Have fun. Cheerful regards, Mike McLaren, K8LH Quote Link to post Share on other sites
RobG 1,892 Posted January 27, 2011 Author Share Posted January 27, 2011 No you didn't. Constructive critique is always a good thing, that's how we learn. I would probably reuse that piece over and over and then I would be surprised why stuff doesn't work. And I would assume that my code is fine. That's why we should have peer reviews. 73 Rob Quote Link to post Share on other sites
Mac 67 Posted January 27, 2011 Share Posted January 27, 2011 Well Rob, there's still a couple things wrong with that section. Then there's your misconceptions about debouncing (grin). But how about if we save those discussions for another day? I don't want to wear out my welcome (lol)... Vy 73, Mike, K8LH Quote Link to post Share on other sites
RobG 1,892 Posted January 27, 2011 Author Share Posted January 27, 2011 Ha, ha, yeah, I really need the rest, or test my changes before posting. Since switchReady is int, we need to either change it (and the switchStatus) to char unsigned char switchReady = 0; // when BITn is 0, means switch is unstable H->L or L->H unsigned char switchStatus = 0; // pressed or released or change if statement if(switchReady == 0xFFFF) As I wrote before, I had that code in another project where I used 16 switches and full USISR register (hence int) but in my if statement I only needed few of them tested. Not sure what you mean by misconceptions about de-bouncing though. Again, as I wrote before, this is just an example of how it could be done. Someone might have a requirement to scan every 5ms, or use switches that have long bounce time, or that all switches must be in sync. I wish I had more time to elaborate and make some drawings, but I think we can leave it at that. Is it perfect, no, is it needed for this particular example, probably not, it can be removed. Quote Link to post Share on other sites
sirri 28 Posted January 3, 2013 Share Posted January 3, 2013 it seems quite confusing for me : / is there an energia library or method to send data to shift register ? i want to use 3 pins in LP to control 8 pins of 8 segment led display.. : / Quote Link to post Share on other sites
ludwig michael 0 Posted January 31, 2013 Share Posted January 31, 2013 The 74595 shift registers can be replaced by a single chip max 7221. It can drive up to 8 seven segments and uses SPI to communicate to msp430. It saves quite a few I/o pins. Price wise, it's about the same price too ( even cheaper, if we buy from china. I just put an order to purchase 10 pcs of the chip for total of $6 including shipping) Quote Link to post Share on other sites
RichardVowles 12 Posted January 31, 2013 Share Posted January 31, 2013 Yeah, buying chips from China is pretty hit and miss. They seem better on the more complex stuff. Quote Link to post Share on other sites
RobG 1,892 Posted January 31, 2013 Author Share Posted January 31, 2013 The only problem, MAX7221 is a 5V device. You should be using MAX6951 for 3V applications. hkn544 1 Quote Link to post Share on other sites
hkn544 0 Posted May 11, 2021 Share Posted May 11, 2021 İ will use 8 digit 7segment and i need to implement your code for 8 digit. Also first 4 digit will show something other 4 digit will show temprature. So how can i change your code? İ couldnt understand excatly. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.