h4nd Posted December 24, 2018 Share Posted December 24, 2018 5 hours ago, Ghostchips said: I looked at the examples and got a bunch of error codes when i tried to make it function. I don't even know what a stray slashNumber is.. Pretty sure the pages of reference is where i got this unusable code from. "How hard could it be, that guy down south made his dashboard indicator light controller in one night". Turns out it's impossible. And now everyone will know i'm dumber than shit & shouldn't exist. Problem is the extra semicolons at the end of the if lines (sorry I didn't spot it earlier). Did you get any of the standard examples working? It's a really good place to start. Quote Link to comment Share on other sites More sharing options...
h4nd Posted December 24, 2018 Share Posted December 24, 2018 Also, programming, you have to get everything right, so easier to start small, get it going, then change one thing at a time. Quote Link to comment Share on other sites More sharing options...
h4nd Posted December 24, 2018 Share Posted December 24, 2018 / just takes practice. Quote Link to comment Share on other sites More sharing options...
Ghostchips Posted December 24, 2018 Share Posted December 24, 2018 Yup, blink is easy. Reprogramming it to morse code was easy, string of lights blinking at different rates was easy. One sensor that activates one relay was easy. Multi sensors, not yet. Quote Link to comment Share on other sites More sharing options...
h4nd Posted December 24, 2018 Share Posted December 24, 2018 3 hours ago, Ghostchips said: Yup, blink is easy. Reprogramming it to morse code was easy, string of lights blinking at different rates was easy. One sensor that activates one relay was easy. Multi sensors, not yet. Merry Christmas: const int sensorPin1 = A1; const int sensorPin2 = A2; const int sensorPin3 = A3; int sensorValue = 0; int sensorThreshold = 900; int sensorMax = 0; void setup() { pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); } void flashIfHigh(uint8_t inPin, uint8_t outPin) { if (analogRead(inPin) >= sensorThreshold) { digitalWrite(outPin, !(digitalRead(outPin))); } else { digitalWrite(outPin, LOW); } } void loop() { delay(200); flashIfHigh(sensorPin1, 2); flashIfHigh(sensorPin2, 3); flashIfHigh(sensorPin3, 4); } 2 Quote Link to comment Share on other sites More sharing options...
Ghostchips Posted December 25, 2018 Share Posted December 25, 2018 It's a Christmas programming miracle! Now to add variables that speed up the delay based on prior input repetition. ...and i have enough spare parts to make an electronic injector system... Hmm.. 4 Quote Link to comment Share on other sites More sharing options...
h4nd Posted December 25, 2018 Share Posted December 25, 2018 Specification unclear. The arduino is now stuck in my ear. 1 Quote Link to comment Share on other sites More sharing options...
Ghostchips Posted December 25, 2018 Share Posted December 25, 2018 I noticed that when the magnet hovers over the sensor the output pulses over & over. For my application this time that's not a problem and i can make it an advantage. For other things there might be something required to make it pulse once only. Sounds simple but i bet it'll need massive restructure of the code. Quote Link to comment Share on other sites More sharing options...
flyingbrick Posted December 26, 2018 Author Share Posted December 26, 2018 What do you mean by pulses? Is it a tach signal or wheel speed or something? Might be easier for you to explain the whole project also.. isnt it satisfying when shit works 1 Quote Link to comment Share on other sites More sharing options...
rusty360 Posted December 28, 2018 Share Posted December 28, 2018 Ok I'm not sure if someone will know the answer but here goes. I need a thing to count how many packs are being processed per min and displayed on a screen. I can get the trigger or pulses easily off the machine. But then would need a unit or program to display this as a number per min. I would need to display the last minutes product while counting the next one and so on. Any ideas? Cheers rusty Quote Link to comment Share on other sites More sharing options...
IvyMike Posted December 28, 2018 Share Posted December 28, 2018 If you get yourself an Arduino and a basic display (LCD1602 or similar) that shouldn't be hard to accomplish. If you use something like this as a guide: https://www.youtube.com/watch?v=dZZynJLmTn8 it should help you get on your feet. Quote Link to comment Share on other sites More sharing options...
rusty360 Posted December 28, 2018 Share Posted December 28, 2018 24 minutes ago, IvyMike said: If you get yourself an Arduino and a basic display (LCD1602 or similar) that shouldn't be hard to accomplish. If you use something like this as a guide: https://www.youtube.com/watch?v=dZZynJLmTn8 it should help you get on your feet. Sweet as cheers for the info. I'd like to display the info on a small tv screen say 19inch. Dies that change anything? Quote Link to comment Share on other sites More sharing options...
IvyMike Posted December 28, 2018 Share Posted December 28, 2018 2 minutes ago, rusty360 said: Sweet as cheers for the info. I'd like to display the info on a small tv screen say 19inch. Dies that change anything? Yeah, Arduino isn't really VGA/HDMI friendly. It might pay to use a Raspberry Pi instead. Youtube has loads of tutorials for those as well. Quote Link to comment Share on other sites More sharing options...
h4nd Posted December 28, 2018 Share Posted December 28, 2018 Although, it can be done, if you want a technical challenge: https://forum.arduino.cc/index.php?topic=102181.0 1 Quote Link to comment Share on other sites More sharing options...
rusty360 Posted December 29, 2018 Share Posted December 29, 2018 Cheers for the info guys I'll have a looky at the raspberry pi info online. Quote Link to comment Share on other sites More sharing options...
Ned Posted January 6, 2019 Share Posted January 6, 2019 theres a video chip you can still get from china. Max7456 or something like that. It's on all quadcopter OSDs... so you could buy a minimOSD for $10 and reprogram that to do what you want is you really want a composite video signal for a big screen? or just build/buy a large 7 seg display? 1 Quote Link to comment Share on other sites More sharing options...
rusty360 Posted January 8, 2019 Share Posted January 8, 2019 On 07/01/2019 at 09:49, Ned said: theres a video chip you can still get from china. Max7456 or something like that. It's on all quadcopter OSDs... so you could buy a minimOSD for $10 and reprogram that to do what you want is you really want a composite video signal for a big screen? or just build/buy a large 7 seg display? I'm thinking raspberry pi is ticket as I can just plug a computer screen in and go. I've just gotta learn how to write the program now!! And pick what model pi to buy! Quote Link to comment Share on other sites More sharing options...
Roman Posted January 14, 2019 Share Posted January 14, 2019 Was trying to think of a way to make the function names stand out a bit better when scrolling up and down through lots of code. Found an ascii font generator. It's glorious. 5 Quote Link to comment Share on other sites More sharing options...
Ned Posted January 14, 2019 Share Posted January 14, 2019 looks good. Just a couple tips (some controversial and waiting for @h4nd to tell me im wrong ) replace if (IncrementCounter == 9000) { IncrementCounter = 0; } with >= 9000 so it still works if it ever skips 9000. I know it wont skip 9000, but there is a reasonable chance that at some point you'll be like "fuck, this takes ages, i wonder how the thing looks when i increase the values heaps and fast?" and change the IncrementCounter = IncrementCounter + 1; to IncrementCounter = IncrementCounter + 5; just for kicks, and then shit will no longer work right and second, your variable naming techniques this is the controversial part as everyone has their own standard... but most people will start their variable names with a lower case, so its easy to differentiate from function names. so IncrementCounter to most looks like a function, whereas incrementCounter would be a variable. It's especially handy in IDEs like the arduino one as it doesnt do auto complete and function complete things etc, so it just reads a bit easier and helps you make less mistakes. 3 1 Quote Link to comment Share on other sites More sharing options...
Roman Posted January 15, 2019 Share Posted January 15, 2019 Aahhh yes I've noticed that people start with lower case for first letter but didnt know why. (As it seems easier for me to read with upper) But that makes sense. Cheers Quote Link to comment Share on other sites More sharing options...
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.