Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is it possible???

Status
Not open for further replies.
I'm glad it works, but if I can offer some more advice regarding general programming practices, don't fall into the "not invented here" trap. Just because someone else wrote something doesn't make it bad, just because you wrote something doesn't make it good (and vice versa). You said that NorthGuy's code was exactly what you were after, but then you've basically ignored it and continued with your original mess. OK it's a little bit less of a mess now, and it works, so that's an obvious improvement but NorthGuy's design is far easier to read and understand and presumably does the same thing (I still haven't managed to follow your code all the way through to confirm that).

If the two are functionally equivalent, then you should have thrown yours out and used his. Yeah it sucks to see something you've worked hard on get chucked out and replaced with someone else's work, but part of being a good designer is recognising good design even when it isn't your own and knowing when it is better to abandon a given approach and start over.
 
Just to add to what heydonms said, even if you don't use other peoples code, reading and understanding it will teach you far more than most of your classes.

Mike.
 
NorthGuy , Yep Sir I know it'll trigger the last one if three buttons where pressed but our instruction was only specify for two buttons. That's why I do not take consider if i hold 3 buttons at the same time. I am with you Sir :), though I do not follow your pseudo codes but it helps me to complete my work. I just cant make it simpler than how you want it to be coz im just beginner. Also, I recognize all of your concerns Sir. Gracias!
 
I know it'll trigger the last one if three buttons where pressed but our instruction was only specify for two buttons. That's why I do not take consider if i hold 3 buttons at the same time.

Such requirements look strange to me. User can (and will!) press 3 buttons together. How is it going to be used?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top