Home |
Search |
Today's Posts |
|
UK diy (uk.d-i-y) For the discussion of all topics related to diy (do-it-yourself) in the UK. All levels of experience and proficency are welcome to join in to ask questions or offer solutions. |
Reply |
|
LinkBack | Thread Tools | Display Modes |
#81
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Sun, 22 Oct 2017 22:57:55 +0100, Tjoepstil
wrote: On 22/10/17 22:39, T i m wrote: those who bother with him could be considered to be playing a positive part in his 'eCare in the community'. you will live to eat those words I can see exactly how your life will pan out Hey, have you spoken to my 'psychiatric counseeller'? Cheers, T i m |
#82
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 22/10/17 23:25, T i m wrote:
On Sun, 22 Oct 2017 22:57:55 +0100, Tjoepstil wrote: On 22/10/17 22:39, T i m wrote: those who bother with him could be considered to be playing a positive part in his 'eCare in the community'. you will live to eat those words I can see exactly how your life will pan out Hey, have you spoken to my 'psychiatric counseeller'? wtf is a counseeller? Cheers, T i m |
#83
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Mon, 23 Oct 2017 01:23:36 +0100, Tjoepstil
wrote: On 22/10/17 23:25, T i m wrote: On Sun, 22 Oct 2017 22:57:55 +0100, Tjoepstil wrote: On 22/10/17 22:39, T i m wrote: those who bother with him could be considered to be playing a positive part in his 'eCare in the community'. you will live to eat those words I can see exactly how your life will pan out Hey, have you spoken to my 'psychiatric counseeller'? wtf is a counseeller? You had better ask TNP. Cheers, T i m |
#84
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Mon, 23 Oct 2017 00:08:43 +0100, pamela wrote:
On 22:39 22 Oct 2017, T i m wrote: On 22 Oct 2017 20:15:18 GMT, Bob Eager wrote: ........ TNP is beyond hope. I'm beginning to believe you are right. ;-( Oh well, if nothing else, those who bother with him could be considered to be playing a positive part in his 'eCare in the community'. ;-) Cheers, T i m "eCare in the Community" lol! Does he qualify for more support funds if he's needs a lot of attention? Pass. I just thought that given he explained here that he has two persona (one real and one online (that now may be more than one?)), and given (he said) the online one was aggressive and obviously a rude, insulting bully, that one might appreciate a little eTLC? It was a bit disingenuous of him to cut the smiley off the end of my comment though eh? But hey ho, he obviously has a passion for his chosen OS (of all things) so I think it might be best to leave them to each other. ;-) Cheers, T i m |
#85
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 22/10/2017 22:39, T i m wrote:
On 22 Oct 2017 20:15:18 GMT, Bob Eager wrote: On Sun, 22 Oct 2017 19:54:34 +0000, Bob Eager wrote: On Sun, 22 Oct 2017 19:41:39 +0100, The Natural Philosopher wrote: Whrn a main clains 40 years IT experience and can't get Linux to work... ...you know all you need to know about his intelligence. Linux has not been around for all that time - 25 years ago it was unstable and relatively little used. You confuse knowledge and intelligence. You appear to have knowledge, but the intelligence is lacking. Tim's intelligence means you could acquire the know;edge - if he wanted to. Of course, I meant Tim could acquire the knowledge! Any right brainer could work out what you meant Bob. ;-) But not wanting to contradict your kind intentions, I'm not sure I could really get under the hood of Linux (or anything similar), simply because I don't work / think that way. It's like I have no interest in playing Chess or cards, possibly because I don't have a good memory or a 'mathematical mind? By that I mean there are people who are good with (say) hardware and people who are good with software and I'm definitely not the latter. Ok, I *have* done some coding over the years (PDP 11 / Sinclair / BBC basic) and recently with the Arduino microcontrollers and whilst I enjoy it when it works (and appreciate it's power and flexibility), I get very very frustrated not knowing what I need to do to make something I want work. Now, I dare say with the right tuition / mentoring or enough trial and error I might be able to do more, I really don't think I'm wired to ever be good at it (especially in comparison with my programmer mate who seems able to glance at some code and instinctively (it seems) understand it)? He helps me with doing what he understands and is good at and I in turn help him with electronics and hardware. 'Everyone to their own'. ;-) As far as programming Arduinos and the like goes - break everything down into self-contained functions with local variable and try only to interact with them by passing and returning parameters. That way you only have to get one function at a time working and don't have to worry about changes within one piece of code interacting to break another piece. SteveW |
#86
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 23/10/17 19:54, Steve Walker wrote:
As far as programming Arduinos and the like goes - break everything down into self-contained functions with local variable and try only to interact with them by passing and returning parameters. That way you only have to get one function at a time working and don't have to worry about changes within one piece of code interacting to break another piece. its no point trying to teach structured programming techniques to someone who can't even install Linux. |
#87
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Mon, 23 Oct 2017 19:54:06 +0100, Steve Walker
wrote: snip As far as programming Arduinos and the like goes - break everything down into self-contained functions Ok, I get that, 'modularise'? with local variable As opposed to global? and try only to interact with them by passing and returning parameters. Ok, I'm not sure what that means? That way you only have to get one function at a time working and don't have to worry about changes within one piece of code interacting to break another piece. I understand the words but not sure what it would mean in practice (other than I may already be doing so). ;-) For my (limited) understanding of such things ... (and re the Arduino specifically) they work in sequence, possibly looping at certain points or looping various sub modules within each other (nesting?). You may also be looking for input data (reading sensors), looking or waiting for triggers (switches, values) and doing or outputting stuff, possibly as a function of any of the above. So, say I wanted a digital voltmeter. I would read an analogue pot, translate that reading into what it relates to (so 2.5V read = 12v) and output that value to an LCD display. I might pause it long enough to give a easily readable display before looping round again. I could also program it to say turn on an alarm sounder and / or release a relay if / when the voltage meets a particular criteria. The problem for me would be to provide say a means of setting said trigger voltage real-time (using input switches etc) before running the main routine. FWIW I have successfully configured / run many a stand alone module (rtc, DMM, BT TX RX, Web Server, PCM controller, tri-state PCM LED driver, I2C devices, logging to file on SD card etc etc) and where the function is self setting and pretty linear, had it doing multiple things (read voltage, read current, read time, display voltage, current, time, watts), it's just the interactive stuff I haven't really dealt with that much. The thing is, my maths was never much past straight arithmetic and I as soon as it get's into fields and strings and complex formulae I back out and want to go and build something from metal. ;-) Give me an existing program and I can usually work out how it works and tweak it where required (which is basically how I get most of my stuff started). But like 'learning Linux', I don't really *want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Plus, I'm into too many things as it is and any of this is right down the bottom of my 'would like to' list, let alone my 'to do' list. The difference between Arduino projects and Linux is there are actually things I want / need to do with the Arduino's that I can't really do with anything else. Luckily I do have a really good mate who is also a really good coder and who can (and does) connect to my PC remotely and wave his magic over my tested sub modules and make them work together. ;-) Cheers, T i m p.s. I just spent 5 hours helping an elderly neighbour reset her W7 laptop back the way she wants it after getting it back from PCW. I did it for two cups of tea and some fancy biscuits, because I'm reasonably good at it and it helped her. I really should have been doing loads of other and more important things, but she needed help so ... (I did show her Linux briefly (when testing to see why the laptop WiFi couldn't see her router) but ran short of time and justification to install it on there for her dual boot. Maybe next time.) |
#88
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 23/10/2017 22:22, T i m wrote:
On Mon, 23 Oct 2017 19:54:06 +0100, Steve Walker wrote: snip As far as programming Arduinos and the like goes - break everything down into self-contained functions Ok, I get that, 'modularise'? with local variable As opposed to global? Yes. Local variables cannot be seen outside the function, so cannot interfere with another part of the program. and try only to interact with them by passing and returning parameters. Ok, I'm not sure what that means? Basically, not using global variables. When you call a function, you follow it with the information that it needs - eg: if you have defined a funtion to flash an LED, you might pass it the output pin, flash rate in milliseconds and number of flashes - "flash_led (D7, 500, 50)" If it were a calculation routine, you'd get a value back as well, so "speed = calculate_speed (distance, time)" That way you only have to get one function at a time working and don't have to worry about changes within one piece of code interacting to break another piece. I understand the words but not sure what it would mean in practice (other than I may already be doing so). ;-) For my (limited) understanding of such things ... (and re the Arduino specifically) they work in sequence, possibly looping at certain points or looping various sub modules within each other (nesting?). You may also be looking for input data (reading sensors), looking or waiting for triggers (switches, values) and doing or outputting stuff, possibly as a function of any of the above. So, say I wanted a digital voltmeter. I would read an analogue pot, translate that reading into what it relates to (so 2.5V read = 12v) and output that value to an LCD display. I might pause it long enough to give a easily readable display before looping round again. So you write a function to read a pot and convert the value, with you passing it which pin, the value to return for 0V and the value to return for 5V and it returns the calculated value. You could do it without any parameters, hard-coding everything, but passing parameters means that you can take that function in the future and drop it into ny other program that you write that may require different IO or ranges. I could also program it to say turn on an alarm sounder and / or release a relay if / when the voltage meets a particular criteria. The problem for me would be to provide say a means of setting said trigger voltage real-time (using input switches etc) before running the main routine. If you are looking at switch input (rather than keypad and LCD), that could be something as simple as pre-setting the value on BCD switches and then pressing an ENTER button. As soon as ENTER is pressed, the value is read and copied into a variable. First go around everything is held until ENTER is pressed and then the loop can begin. Each loop checks for ENTER and if it isn't pressed, the functions that read the pot and do the alarm comparisons are run. If ENTER is pressed, the new setting is read and stored before continuing. For more complex systems, maybe with keypad entry and lcd display, you could read buttons and update the LCD during each loop, with your own function to add digits, etc. to a string and display it on each kepress and transfer the final value on ENTER - so no sitting waiting for input. The better way would be to use interrupts so that user interaction is independent of the rest of the program, but that would be a whole new thing to learn - you'd find many examples on the net though. The simplest way (allowing for a few hours learning) is to split your program into sections (User interaction, Input/Calculation, Alarm checking, Display/sounder operation) and run them as separate, but communicating (by simple flags) programs under a Real-Time Operating System (RTOS). Once you get your head around the idea, it makes everything so simple, because each section runs independently and you don't have to worry about timing. So the User interaction program simply waits for input and sets the alarm value when it has a valid value; the Input/calculation program keeps reading the pot and calculating the value, which it makes available; the alarm program compares the input value with the alarm value and raises and alarm flag is needed; the Display/sounder program displays the calculated input value, display an alarm if the alarm flag is set and operates the sounder as required. Its all in the flags/values passed and none of the programs need to synchronise with the others. FWIW I have successfully configured / run many a stand alone module (rtc, DMM, BT TX RX, Web Server, PCM controller, tri-state PCM LED driver, I2C devices, logging to file on SD card etc etc) and where the function is self setting and pretty linear, had it doing multiple things (read voltage, read current, read time, display voltage, current, time, watts), it's just the interactive stuff I haven't really dealt with that much. So you are most of the way there. The thing is, my maths was never much past straight arithmetic and I as soon as it get's into fields and strings and complex formulae I back out and want to go and build something from metal. ;-) Give me an existing program and I can usually work out how it works and tweak it where required (which is basically how I get most of my stuff started). But like 'learning Linux', I don't really *want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Learning Linux is a long involved process (as is Windows, but most people don't notice as they've picked bits up over a long period). To me, the beauty of Arduinos is that there isn't an operating system (or only a very simple RTOS) getting in the way as there are only basic IO and calculations, not the huge number of interactions and settings of PC programs and OSs. Plus, I'm into too many things as it is and any of this is right down the bottom of my 'would like to' list, let alone my 'to do' list. Fair enough - I have the same problem, what with work, wife, kids, household DIY, kit-car, model railway, computers, Arduinos, PICs, etc. The difference between Arduino projects and Linux is there are actually things I want / need to do with the Arduino's that I can't really do with anything else. Arduinos are so simple compared to a PC that it can be worth spending time learning it - it being so quick to learn about. Luckily I do have a really good mate who is also a really good coder and who can (and does) connect to my PC remotely and wave his magic over my tested sub modules and make them work together. ;-) Fair enough. The fact that you are using tested sub-modules is the biggest part of structured programming, so you are well on the way anyway. Cheers, T i m p.s. I just spent 5 hours helping an elderly neighbour reset her W7 laptop back the way she wants it after getting it back from PCW. I did it for two cups of tea and some fancy biscuits, because I'm reasonably good at it and it helped her. I really should have been doing loads of other and more important things, but she needed help so ... (I did show her Linux briefly (when testing to see why the laptop WiFi couldn't see her router) but ran short of time and justification to install it on there for her dual boot. Maybe next time.) |
#89
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 23/10/17 22:22, T i m wrote:
But like 'learning Linux', I don't really*want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Translate: "I am a fat lazy sod who does only what he want to do and believe that stuff should be made easy and enjoyable for me, because thats my *right* and I will vote for anyone who promises that, irrespective of whether it's deliverable or not. And I know it would be too long and time consuming because...I have never bothered to find out how long and time consuming it would be. I have this magic mystical ability, akin to Gnosis, where I just *know* stuff without having to investigate or think. Curiously this ability is linked to massive marketing campaigns. I *know* that windows is good and Linux is not, because everyone on the telly says so. I *know* that staying in the EU is the right thing, because everyone in the beeb laughs at brexiteers and tells me how pathetic they are." |
#90
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Mon, 23 Oct 2017 23:37:32 +0100, Steve Walker
wrote: On 23/10/2017 22:22, T i m wrote: On Mon, 23 Oct 2017 19:54:06 +0100, Steve Walker wrote: snip As far as programming Arduinos and the like goes - break everything down into self-contained functions Ok, I get that, 'modularise'? with local variable As opposed to global? Yes. Local variables cannot be seen outside the function, so cannot interfere with another part of the program. Again, whilst I sort of understand the words I'm not really sure how it would work ITRW. Like, if I define (declare?) a variable in the setup, isn't that variable open to use anywhere in the in the entire program? Can I define / declare a variable just within say a for - next loop and be able to re=-define / declare it again elsewhere, without it affecting the other one? and try only to interact with them by passing and returning parameters. Ok, I'm not sure what that means? Basically, not using global variables. When you call a function, you follow it with the information that it needs - eg: if you have defined a funtion to flash an LED, you might pass it the output pin, flash rate in milliseconds and number of flashes - "flash_led (D7, 500, 50)" Ok ... so you don't actually define / declare it previously anywhere as such? It's only 'activated' at that instant? If it were a calculation routine, you'd get a value back as well, so "speed = calculate_speed (distance, time)" Ok, well I think I've done that (or similar) with my battery monitor project with watts from volts and amps etc. snip So, say I wanted a digital voltmeter. I would read an analogue pot, translate that reading into what it relates to (so 2.5V read = 12v) and output that value to an LCD display. I might pause it long enough to give a easily readable display before looping round again. So you write a function to read a pot and convert the value, with you passing it which pin, the value to return for 0V and the value to return for 5V and it returns the calculated value. Ok. You could do it without any parameters, hard-coding everything, but passing parameters means that you can take that function in the future and drop it into ny other program that you write that may require different IO or ranges. So I might read the local value of the voltage input pin, calculate the external voltage and have that value equal to 'InstantVolts' for example? I could also program it to say turn on an alarm sounder and / or release a relay if / when the voltage meets a particular criteria. The problem for me would be to provide say a means of setting said trigger voltage real-time (using input switches etc) before running the main routine. If you are looking at switch input (rather than keypad and LCD), that could be something as simple as pre-setting the value on BCD switches and then pressing an ENTER button. As soon as ENTER is pressed, the value is read and copied into a variable. Yup, Ok ... First go around everything is held until ENTER is pressed and then the loop can begin. Each loop checks for ENTER and if it isn't pressed, the functions that read the pot and do the alarm comparisons are run. If ENTER is pressed, the new setting is read and stored before continuing. Ah, ok, but say said 'Calibration' routine *is* only needed once / initially, could / would I put it in the setup routine or in the main program but prior to the main program loop? For more complex systems, maybe with keypad entry and lcd display, you could read buttons and update the LCD during each loop, with your own function to add digits, etc. to a string and display it on each kepress and transfer the final value on ENTER - so no sitting waiting for input. Yes, so say I wanted to set a particular low voltage value to create a Low Voltage Disconnect. After powering up I want it to prompt me to 'Set Voltage' (easy). Then I want it to initially display a 'safe' value (easy) but then monitor two buttons that relate to Up / Down, or one button that takes the values in a cycle from typical min to typical max before I then 'Ok' that with either an additional button (safe) or waiting a preset time of no activity (say 5 seconds, less safe)? See, I know what I want to do, know how I might use it ITRW, might be able to find examples of code that do similar but the 'fitting' of it into my particular scenario often overwhelms me and I give up. What is frustrating for me is that I rarely give up with anything *that I feel I have a chance (often fairly small even) of succeeding with*. The better way would be to use interrupts so that user interaction is independent of the rest of the program, but that would be a whole new thing to learn - you'd find many examples on the net though. As above. Taking them from a RW example and slotting them into my project is like saying (to me) 'all you need to do to be a brain surgeon is to study and practice being a brain surgeon' (when all I have done for most of my life is fix stuff with a soldering iron). The simplest way (allowing for a few hours learning) is to split your program into sections (User interaction, Input/Calculation, Alarm checking, Display/sounder operation) and run them as separate, Ok, I have much of that, tested and got it working ... but mostly as individual modules (not so much with the human input stuff). but communicating (by simple flags) programs under a Real-Time Operating System (RTOS). Once you get your head around the idea, it makes everything so simple, because each section runs independently and you don't have to worry about timing. Ok ... ? So the User interaction program simply waits for input and sets the alarm value when it has a valid value; the Input/calculation program keeps reading the pot and calculating the value, which it makes available; the alarm program compares the input value with the alarm value and raises and alarm flag is needed; the Display/sounder program displays the calculated input value, display an alarm if the alarm flag is set and operates the sounder as required. Yes, I think I have that already with my battery monitor, minus the manual input / threshold setting stuff. A loop that contains the reading of inputs and displaying the converted values they are supposed to represent seem to be doable (as I've done it), it's the making it 'interactive' bit I've stumbled on. Now I have had a multi-button type input pad working and displaying the name of which button I've pressed but again mostly plagiarise and with no idea how I would integrate that in my own program. Its all in the flags/values passed and none of the programs need to synchronise with the others. Ok ... ? FWIW I have successfully configured / run many a stand alone module (rtc, DMM, BT TX RX, Web Server, PCM controller, tri-state PCM LED driver, I2C devices, logging to file on SD card etc etc) and where the function is self setting and pretty linear, had it doing multiple things (read voltage, read current, read time, display voltage, current, time, watts), it's just the interactive stuff I haven't really dealt with that much. So you are most of the way there. No, I don't seem to be ... and the biggest hurdle seems to be *how* I integrate these modules into the final solution. Ok, say I write a voltmeter 'loop'. Reads the value on a pin, does the translation, displays the massaged value on a 4 x 16 lcd display. Then I want to add to that a current reading, I simply slip that inside the loop at the bottom and the loop now contains both routines (it might pause for one second to give you chance to read the values then clear the value fields just before updating them again, so you don't get any orphaned characters etc). But say I wanted to watch for a particular voltage trend - threshold (low battery level) (easy, just include that check at the bottom of my loop) and then say sound an alarm for 5 seconds (easy if the previous check was part of an If-then loop) then shut off the alarm and release a relay ... then continue to display the voltage but otherwise 'stop', it's knowing 'how' one should construct a solution? eg. I have previously programmed steps manually that I know could be in a loop but the means of looping them escape me (and I have had running LEDS going up and down and looping and all flashing etc, and using loops, albeit, mostly cribbed them massaged etc). The thing is, my maths was never much past straight arithmetic and I as soon as it get's into fields and strings and complex formulae I back out and want to go and build something from metal. ;-) Give me an existing program and I can usually work out how it works and tweak it where required (which is basically how I get most of my stuff started). But like 'learning Linux', I don't really *want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Learning Linux is a long involved process (as is Windows, but most people don't notice as they've picked bits up over a long period). Quite, and little of 'picking up Windows' involves dropping to the CLI and typing gobbledygook where the typing accuracy has to be 100% (even to the case etc!), let alone the command and syntax. In the most part, Windows can be explored (because most things can be done in the GUI), Linux needs to be learned. me, the beauty of Arduinos is that there isn't an operating system (or only a very simple RTOS) getting in the way as there are only basic IO and calculations, not the huge number of interactions and settings of PC programs and OSs. Quite ... and why I have only ever used my RPi's as computers, not micro controllers. Plus, I'm into too many things as it is and any of this is right down the bottom of my 'would like to' list, let alone my 'to do' list. Fair enough - I have the same problem, what with work, wife, kids, household DIY, kit-car, model railway, computers, Arduinos, PICs, etc. Exactly. It's not that I don't want to, it's the real world acceptance that *realistically* I am so far behind in the whole programming thing that it will take a disproportional amount of my time to achieve my goals, and even if it works, I would have no idea if it was being do the most efficiently (and because I like to do whatever I do 'right', would bug me). The difference between Arduino projects and Linux is there are actually things I want / need to do with the Arduino's that I can't really do with anything else. Arduinos are so simple compared to a PC that it can be worth spending time learning it - it being so quick to learn about. Ah, but that may be a function of your previous (programming) experience and your particular aptitude to such things (including maths). Ok, when our daughter was living in Scotland with her bf and his family, they noticed the n/s/f wishbone on their Corsa was 'clonking' and I said it would be something they could do themselves (because I could and both of them are reasonably practical). So I talked them through it, they also had the Haynes manual but they basically failed at the first hurdle (after getting the wheel off) because they couldn't get on, or undo a particular nut. Now the frustration was that I could, so if I could then 'anyone could', couldn't they? My point is that we are all good at something and not all good at the same things ... I don't like or play Chess, I'm not good with maths (outside basic arithmetic and simple formula etc) and after playing with 'programming' on and off for over 40 years, know I'm not really good at that either. Luckily I do have a really good mate who is also a really good coder and who can (and does) connect to my PC remotely and wave his magic over my tested sub modules and make them work together. ;-) Fair enough. The fact that you are using tested sub-modules is the biggest part of structured programming, so you are well on the way anyway. Well I did that because I didn't think it fair to have him try to understand all the mechanical requirements of the various Arduino's, or all the modules. I've even set him some of the stuff, pre hooked up to the sub-modules so it can make it easier for him to help me (and he is equally interested in getting more familiar with some of the electronics etc). But like me, the goal isn't to 'learn electronics', it's to have an easy / guided insight to the world of electronics knowing that someone who does know a bit about it, will deal with any electronic hurdles along the way, leaving him clear just to do the coding etc. It is such that I would be (as I said), happy to trade skills or even pay *something* to someone who actually considers programming an enjoyable challenge or happy to do it because they just enjoy it and / or enjoy helping people (as I do every day with something for someone). I have a couple of mates who will struggle with PC related problems (both of them running Linux btw) rather than 'disturbing me because they know I'm so busy'. The frustration for me is that for me it's often just a few *seconds* on Teamviewer so it isn't an issue for me and I know I can ask them for help (and get it) if / when required (even if I rarely do). The frustrating thing for me is I love the whole Arduino thing (for the reasons you state),I like all the electronics stuff and I have loads of projects in mind using them and even have the (Arduino powered) 3D printer to print bits for any project I build ... it's just I know the chances are I wouldn't have the time, patience or confidence to complete the coding bit ... so the parts just sit here. ;-( Cheers, T i m |
#91
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Tue, 24 Oct 2017 04:13:15 +0100, Tjoepstil
wrote: On 23/10/17 22:22, T i m wrote: But like 'learning Linux', I don't really*want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Translate: "I am a fat lazy sod who does only what he want to do and believe that stuff should be made easy and enjoyable for me, Correct .... (no translation needed) and luckily for me and all those who like to have an easy life as possible, that's the way everything is going. because thats my *right* Nope, not my right, just the way everything is going. and I will vote for anyone who promises that, irrespective of whether it's deliverable or not. As I don't generally vote (but spoil my paper) that hasn't happened yet. However, if someone offers free Arduino coding along with loads of stuff that is determined by the majority to be good for the majority and I have some proof they will be able to deliver on it all then yes, I might vote for them. And I know it would be too long and time consuming because...I have never bothered to find out how long and time consuming it would be. Nope, I have already spent many many hours finding out just how time consuming it is. I have this magic mystical ability, akin to Gnosis, where I just *know* stuff without having to investigate or think. No, I like exploring and therefore learning stuff that can be learned that way. This is a process that has served most living things since the beginning. Curiously this ability is linked to massive marketing campaigns. I *know* that windows is good and Linux is not, because everyone on the telly says so. Really? I've never even seen such things on the TV or anywhere? I *know* that staying in the EU is the right thing, because everyone in the beeb laughs at brexiteers and tells me how pathetic they are." If that were the case wouldn't I have voted to remain? Cheers, T i m |
#92
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 24/10/2017 10:07, T i m wrote:
On Mon, 23 Oct 2017 23:37:32 +0100, Steve Walker wrote: On 23/10/2017 22:22, T i m wrote: On Mon, 23 Oct 2017 19:54:06 +0100, Steve Walker wrote: snip As far as programming Arduinos and the like goes - break everything down into self-contained functions Ok, I get that, 'modularise'? with local variable As opposed to global? Yes. Local variables cannot be seen outside the function, so cannot interfere with another part of the program. Again, whilst I sort of understand the words I'm not really sure how it would work ITRW. Like, if I define (declare?) a variable in the setup, isn't that variable open to use anywhere in the in the entire program? Can I define / declare a variable just within say a for - next loop and be able to re=-define / declare it again elsewhere, without it affecting the other one? They are defined in the function definition, eg: int get_key (int l_valid_keys) { // declare local variables int l_key_value, l_key_pressed = 0; boolean l_valid_key_pressed = false; // loop until a valid key is pressed while (!l_valid_key_pressed) { and try only to interact with them by passing and returning parameters. Ok, I'm not sure what that means? Basically, not using global variables. When you call a function, you follow it with the information that it needs - eg: if you have defined a funtion to flash an LED, you might pass it the output pin, flash rate in milliseconds and number of flashes - "flash_led (D7, 500, 50)" Ok ... so you don't actually define / declare it previously anywhere as such? It's only 'activated' at that instant? If it were a calculation routine, you'd get a value back as well, so "speed = calculate_speed (distance, time)" Ok, well I think I've done that (or similar) with my battery monitor project with watts from volts and amps etc. snip So, say I wanted a digital voltmeter. I would read an analogue pot, translate that reading into what it relates to (so 2.5V read = 12v) and output that value to an LCD display. I might pause it long enough to give a easily readable display before looping round again. So you write a function to read a pot and convert the value, with you passing it which pin, the value to return for 0V and the value to return for 5V and it returns the calculated value. Ok. You could do it without any parameters, hard-coding everything, but passing parameters means that you can take that function in the future and drop it into ny other program that you write that may require different IO or ranges. So I might read the local value of the voltage input pin, calculate the external voltage and have that value equal to 'InstantVolts' for example? Yes. But being hardcoded it only ever reads the one pin, does the one calculation and outputs the one variable, whereas if you define a funtion with parameters, it can be more flexible. Lets say that pins AN0 and AN1 have 0-5V signals on them, but you want them scaled 0-100% and 50 to 75mm: voltage_a = return_voltage (AN0, 0, 100) voltage_b = return_voltage (AN1, 50, 75) where voltage_a, voltage_b and the function return_voltage are all defined as integers. And you can drop that function into other programs without problems, because none of the internal workings and variable are exposed to the rest of the program. I could also program it to say turn on an alarm sounder and / or release a relay if / when the voltage meets a particular criteria. The problem for me would be to provide say a means of setting said trigger voltage real-time (using input switches etc) before running the main routine. If you are looking at switch input (rather than keypad and LCD), that could be something as simple as pre-setting the value on BCD switches and then pressing an ENTER button. As soon as ENTER is pressed, the value is read and copied into a variable. Yup, Ok ... First go around everything is held until ENTER is pressed and then the loop can begin. Each loop checks for ENTER and if it isn't pressed, the functions that read the pot and do the alarm comparisons are run. If ENTER is pressed, the new setting is read and stored before continuing. Ah, ok, but say said 'Calibration' routine *is* only needed once / initially, could / would I put it in the setup routine or in the main program but prior to the main program loop? In the setup, baecause you don't want to call it on each iteration of the main loop. For more complex systems, maybe with keypad entry and lcd display, you could read buttons and update the LCD during each loop, with your own function to add digits, etc. to a string and display it on each kepress and transfer the final value on ENTER - so no sitting waiting for input. Yes, so say I wanted to set a particular low voltage value to create a Low Voltage Disconnect. After powering up I want it to prompt me to 'Set Voltage' (easy). Then I want it to initially display a 'safe' value (easy) but then monitor two buttons that relate to Up / Down, or one button that takes the values in a cycle from typical min to typical max before I then 'Ok' that with either an additional button (safe) or waiting a preset time of no activity (say 5 seconds, less safe)? See, I know what I want to do, know how I might use it ITRW, might be able to find examples of code that do similar but the 'fitting' of it into my particular scenario often overwhelms me and I give up. What is frustrating for me is that I rarely give up with anything *that I feel I have a chance (often fairly small even) of succeeding with*. Although a completely different scenario, the following function is one I wrote to input a number and gives you an idea of reading buttons which you could incorporate into the main loop by simply putting the display and increment/decrement lines at the start or end of it and rely upon the main loop to keep iterating through it. int get_number_between_limits(int l_preset_value, int l_min_value, int l_max_value, int l_increment_size, String l_str1, String l_str2) { // declare local variables int l_value = l_preset_value; int l_key = 0; // loop until select key is pressed while (l_key != select) { // display current figure and command keys and wait for a keypress display_lcd (l_str1, String(l_value, DEC) + l_str2); l_key = get_key (up + down + (left + right) * (l_increment_size 1) + select); delay (200); // increment the counter by 1 or by larger increment if u or r respectively are pressed // decrement the counter by 1 or by larger increment if d or l respectively are pressed l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); l_value = l_value - (l_key == down && l_value l_min_value) - l_increment_size * (l_increment_size 1) * (l_key == left && l_value = l_min_value + l_increment_size); // end loop when select has been pressed } // return value return (l_value); } The better way would be to use interrupts so that user interaction is independent of the rest of the program, but that would be a whole new thing to learn - you'd find many examples on the net though. As above. Taking them from a RW example and slotting them into my project is like saying (to me) 'all you need to do to be a brain surgeon is to study and practice being a brain surgeon' (when all I have done for most of my life is fix stuff with a soldering iron). I'll not go into interrupts as I have no examples of my own to hand. The simplest way (allowing for a few hours learning) is to split your program into sections (User interaction, Input/Calculation, Alarm checking, Display/sounder operation) and run them as separate, Ok, I have much of that, tested and got it working ... but mostly as individual modules (not so much with the human input stuff). but communicating (by simple flags) programs under a Real-Time Operating System (RTOS). Once you get your head around the idea, it makes everything so simple, because each section runs independently and you don't have to worry about timing. Ok ... ? So the User interaction program simply waits for input and sets the alarm value when it has a valid value; the Input/calculation program keeps reading the pot and calculating the value, which it makes available; the alarm program compares the input value with the alarm value and raises and alarm flag is needed; the Display/sounder program displays the calculated input value, display an alarm if the alarm flag is set and operates the sounder as required. Yes, I think I have that already with my battery monitor, minus the manual input / threshold setting stuff. A loop that contains the reading of inputs and displaying the converted values they are supposed to represent seem to be doable (as I've done it), it's the making it 'interactive' bit I've stumbled on. Now I have had a multi-button type input pad working and displaying the name of which button I've pressed but again mostly plagiarise and with no idea how I would integrate that in my own program. With a RTOS, you don't have to integrate the two, you run both at once and one sets a variable which the other reads. So you only have to get each part working independently rather than integrating the two into a single program. Its all in the flags/values passed and none of the programs need to synchronise with the others. Ok ... ? FWIW I have successfully configured / run many a stand alone module (rtc, DMM, BT TX RX, Web Server, PCM controller, tri-state PCM LED driver, I2C devices, logging to file on SD card etc etc) and where the function is self setting and pretty linear, had it doing multiple things (read voltage, read current, read time, display voltage, current, time, watts), it's just the interactive stuff I haven't really dealt with that much. So you are most of the way there. No, I don't seem to be ... and the biggest hurdle seems to be *how* I integrate these modules into the final solution. Ok, say I write a voltmeter 'loop'. Reads the value on a pin, does the translation, displays the massaged value on a 4 x 16 lcd display. Then I want to add to that a current reading, I simply slip that inside the loop at the bottom and the loop now contains both routines (it might pause for one second to give you chance to read the values then clear the value fields just before updating them again, so you don't get any orphaned characters etc). Yes, but don't bother clearing them, just pad with spaces so that each new value displayed completely overwrites the previous one. But say I wanted to watch for a particular voltage trend - threshold (low battery level) (easy, just include that check at the bottom of my loop) and then say sound an alarm for 5 seconds (easy if the previous check was part of an If-then loop) then shut off the alarm and release a relay ... then continue to display the voltage but otherwise 'stop', it's knowing 'how' one should construct a solution? eg. I have previously programmed steps manually that I know could be in a loop but the means of looping them escape me (and I have had running LEDS going up and down and looping and all flashing etc, and using loops, albeit, mostly cribbed them massaged etc). If I understand what you are saying, a simple loop that never ends, a boolean variable (say alarm_tripped) set to true before the loop and set to false at the same time as you start the alarm sounding. Just put the alarm checking and sounding in an IF statement controlled by alarm_tripped. Once the alarm trips, the loop continues running and so reads the voltage and displays it, but no longer monitors the threshold or sounds the alarm. The thing is, my maths was never much past straight arithmetic and I as soon as it get's into fields and strings and complex formulae I back out and want to go and build something from metal. ;-) Give me an existing program and I can usually work out how it works and tweak it where required (which is basically how I get most of my stuff started). But like 'learning Linux', I don't really *want* to learn how to code. Not because I'm too lazy or because I know I couldn't get there in the end but because I know how long it would take me, because I believe I wouldn't ever really enjoy it and would rather trade skills with someone who does like it and who is good at it. Learning Linux is a long involved process (as is Windows, but most people don't notice as they've picked bits up over a long period). Quite, and little of 'picking up Windows' involves dropping to the CLI and typing gobbledygook where the typing accuracy has to be 100% (even to the case etc!), let alone the command and syntax. In the most part, Windows can be explored (because most things can be done in the GUI), Linux needs to be learned. To be fair, I started with ZX-81s, Spectrums, QLs and then PC-DOS/MS-DOS, so command line came first for me. There are many things that need command line access in Windows, but often for tweaks that many users won't need. me, the beauty of Arduinos is that there isn't an operating system (or only a very simple RTOS) getting in the way as there are only basic IO and calculations, not the huge number of interactions and settings of PC programs and OSs. Quite ... and why I have only ever used my RPi's as computers, not micro controllers. Plus, I'm into too many things as it is and any of this is right down the bottom of my 'would like to' list, let alone my 'to do' list. Fair enough - I have the same problem, what with work, wife, kids, household DIY, kit-car, model railway, computers, Arduinos, PICs, etc. Exactly. It's not that I don't want to, it's the real world acceptance that *realistically* I am so far behind in the whole programming thing that it will take a disproportional amount of my time to achieve my goals, and even if it works, I would have no idea if it was being do the most efficiently (and because I like to do whatever I do 'right', would bug me). The difference between Arduino projects and Linux is there are actually things I want / need to do with the Arduino's that I can't really do with anything else. Arduinos are so simple compared to a PC that it can be worth spending time learning it - it being so quick to learn about. Ah, but that may be a function of your previous (programming) experience and your particular aptitude to such things (including maths). Ok, when our daughter was living in Scotland with her bf and his family, they noticed the n/s/f wishbone on their Corsa was 'clonking' and I said it would be something they could do themselves (because I could and both of them are reasonably practical). So I talked them through it, they also had the Haynes manual but they basically failed at the first hurdle (after getting the wheel off) because they couldn't get on, or undo a particular nut. Now the frustration was that I could, so if I could then 'anyone could', couldn't they? My point is that we are all good at something and not all good at the same things ... I don't like or play Chess, I'm not good with maths (outside basic arithmetic and simple formula etc) and after playing with 'programming' on and off for over 40 years, know I'm not really good at that either. Luckily I do have a really good mate who is also a really good coder and who can (and does) connect to my PC remotely and wave his magic over my tested sub modules and make them work together. ;-) Fair enough. The fact that you are using tested sub-modules is the biggest part of structured programming, so you are well on the way anyway. Well I did that because I didn't think it fair to have him try to understand all the mechanical requirements of the various Arduino's, or all the modules. I've even set him some of the stuff, pre hooked up to the sub-modules so it can make it easier for him to help me (and he is equally interested in getting more familiar with some of the electronics etc). But like me, the goal isn't to 'learn electronics', it's to have an easy / guided insight to the world of electronics knowing that someone who does know a bit about it, will deal with any electronic hurdles along the way, leaving him clear just to do the coding etc. It is such that I would be (as I said), happy to trade skills or even pay *something* to someone who actually considers programming an enjoyable challenge or happy to do it because they just enjoy it and / or enjoy helping people (as I do every day with something for someone). I have a couple of mates who will struggle with PC related problems (both of them running Linux btw) rather than 'disturbing me because they know I'm so busy'. The frustration for me is that for me it's often just a few *seconds* on Teamviewer so it isn't an issue for me and I know I can ask them for help (and get it) if / when required (even if I rarely do). The frustrating thing for me is I love the whole Arduino thing (for the reasons you state),I like all the electronics stuff and I have loads of projects in mind using them and even have the (Arduino powered) 3D printer to print bits for any project I build ... it's just I know the chances are I wouldn't have the time, patience or confidence to complete the coding bit ... so the parts just sit here. ;-( As you say, I may have more of an aptitude for programming than you, but I haven't seriously programmed for years and had never programmed in C or C++ before. I read an Arduino programming guide during my lunchbreaks and tried a couple example programs and a few tweaks to them over a couple of nights and then, dived into programming an 800 line control of a stepper motor driven model railway turntable with programmable selection of number of tracks, positions, auto-homing, reversal, shortest route, shortest route with reversal, acceleration/deceleration, speed control, EEPROM storage of settings, LCD display and pushbutton control. I just did it by breaking it up into numerous functions and getting one at a time working. Where a function depended upon another that I hadn't written yet, I just put in a few lines of dummy code to return a value or display something and coded that function later. SteveW |
#93
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Wed, 25 Oct 2017 00:12:20 +0100, Steve Walker
wrote: snips for brevity after saving reply in my Arduino docs folder ;-) Again, whilst I sort of understand the words I'm not really sure how it would work ITRW. Like, if I define (declare?) a variable in the setup, isn't that variable open to use anywhere in the in the entire program? Can I define / declare a variable just within say a for - next loop and be able to re=-define / declare it again elsewhere, without it affecting the other one? They are defined in the function definition, eg: int get_key (int l_valid_keys) { // declare local variables int l_key_value, l_key_pressed = 0; boolean l_valid_key_pressed = false; // loop until a valid key is pressed while (!l_valid_key_pressed) { Ok, again, you may be overestimating how someone like me can make use of such information Steve. It would be like me saying to my 87 year old Mum, 'If the boiler doesn't light again, just take the cover off, drop the burner out of the way, remove the pilot jet and clean it and put it all back again and you should be good to go. Even if she understood all the words (and may have watched / helped me doing it years ago), does she have the strength, dexterity, tools (and experience using them to ensure things aren't sheared off by turning them the wrong way or over tightened etc) or eyesight to be able to complete the task? snip So I might read the local value of the voltage input pin, calculate the external voltage and have that value equal to 'InstantVolts' for example? Yes. But being hardcoded it only ever reads the one pin, does the one calculation and outputs the one variable, whereas if you define a funtion with parameters, it can be more flexible. Lets say that pins AN0 and AN1 have 0-5V signals on them, but you want them scaled 0-100% and 50 to 75mm: voltage_a = return_voltage (AN0, 0, 100) voltage_b = return_voltage (AN1, 50, 75) where voltage_a, voltage_b and the function return_voltage are all defined as integers. And you can drop that function into other programs without problems, because none of the internal workings and variable are exposed to the rest of the program. Ok, again, I sorta understand the principles of what you are saying but not sufficiently ... and especially with my current 'offline' Arduino coding status to fully comprehend it's full meaning. It's like you are trying to give directions to someone in a foreign language where they get bits but wouldn't be able to repeat any of it even walk off in the right direction. ;-( snip Although a completely different scenario, the following function is one I wrote to input a number and gives you an idea of reading buttons which you could incorporate into the main loop by simply putting the display and increment/decrement lines at the start or end of it and rely upon the main loop to keep iterating through it. int get_number_between_limits(int l_preset_value, int l_min_value, int l_max_value, int l_increment_size, String l_str1, String l_str2) { // declare local variables int l_value = l_preset_value; int l_key = 0; // loop until select key is pressed while (l_key != select) { // display current figure and command keys and wait for a keypress display_lcd (l_str1, String(l_value, DEC) + l_str2); l_key = get_key (up + down + (left + right) * (l_increment_size 1) + select); delay (200); // increment the counter by 1 or by larger increment if u or r respectively are pressed // decrement the counter by 1 or by larger increment if d or l respectively are pressed l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); l_value = l_value - (l_key == down && l_value l_min_value) - l_increment_size * (l_increment_size 1) * (l_key == left && l_value = l_min_value + l_increment_size); // end loop when select has been pressed } // return value return (l_value); } Wow. This is what I mean about not having the 'mind' for this sort of thing Steve. To me ... and even if I study just one line (other than the comments g) it could nearly be some form of hieroglyph. I see the very general thing each bit is doing but I wouldn't even have the first clue about writing it from scratch myself. snip Yes, I think I have that already with my battery monitor, minus the manual input / threshold setting stuff. A loop that contains the reading of inputs and displaying the converted values they are supposed to represent seem to be doable (as I've done it), it's the making it 'interactive' bit I've stumbled on. Now I have had a multi-button type input pad working and displaying the name of which button I've pressed but again mostly plagiarise and with no idea how I would integrate that in my own program. With a RTOS, you don't have to integrate the two, you run both at once and one sets a variable which the other reads. So you only have to get each part working independently rather than integrating the two into a single program. But would that then allow the buttons to change things mid run when you didn't want them to? snip Ok, say I write a voltmeter 'loop'. Reads the value on a pin, does the translation, displays the massaged value on a 4 x 16 lcd display. Then I want to add to that a current reading, I simply slip that inside the loop at the bottom and the loop now contains both routines (it might pause for one second to give you chance to read the values then clear the value fields just before updating them again, so you don't get any orphaned characters etc). Yes, but don't bother clearing them, just pad with spaces so that each new value displayed completely overwrites the previous one. Sorry, I think that's what I meant I did, so had to adjust the number of spaces dynamically to deal with the range of digits being displayed. Even that took an age to work out as for me, most of it is trial and error (which is also fart of the frustration). But say I wanted to watch for a particular voltage trend - threshold (low battery level) (easy, just include that check at the bottom of my loop) and then say sound an alarm for 5 seconds (easy if the previous check was part of an If-then loop) then shut off the alarm and release a relay ... then continue to display the voltage but otherwise 'stop', it's knowing 'how' one should construct a solution? eg. I have previously programmed steps manually that I know could be in a loop but the means of looping them escape me (and I have had running LEDS going up and down and looping and all flashing etc, and using loops, albeit, mostly cribbed them massaged etc). If I understand what you are saying, a simple loop that never ends, a boolean variable (say alarm_tripped) set to true before the loop and set to false at the same time as you start the alarm sounding. Just put the alarm checking and sounding in an IF statement controlled by alarm_tripped. Once the alarm trips, the loop continues running and so reads the voltage and displays it, but no longer monitors the threshold or sounds the alarm. Ok, I sort of follow that, logically if not what it would require exactly coding-wise. ;-) snip Quite, and little of 'picking up Windows' involves dropping to the CLI and typing gobbledygook where the typing accuracy has to be 100% (even to the case etc!), let alone the command and syntax. In the most part, Windows can be explored (because most things can be done in the GUI), Linux needs to be learned. To be fair, I started with ZX-81s, Spectrums, QLs and then PC-DOS/MS-DOS, so command line came first for me. As did I, but there are only a few CLI instructions you need and most only require some modifiers, rather that actually creating a script or program as such. c:\datacopy *.* c:\backup /e/v/s (from memory) might be as complex as I got? There are many things that need command line access in Windows, but often for tweaks that many users won't need. Quite, or even know exist and yet can still fully maintain their systems. snip The frustrating thing for me is I love the whole Arduino thing (for the reasons you state),I like all the electronics stuff and I have loads of projects in mind using them and even have the (Arduino powered) 3D printer to print bits for any project I build ... it's just I know the chances are I wouldn't have the time, patience or confidence to complete the coding bit ... so the parts just sit here. ;-( As you say, I may have more of an aptitude for programming than you, but I haven't seriously programmed for years But that suggests you have 'seriously programmed' at some point whereas I never have. And this seems to be common amongst the Linux Geeks who 'assume' everyone can understand such things as easily as they can. I cut a hole for a fan in the side of a steel PC case for a geeky mate and he couldn't understand how the hole was: The exact right size. Was completely circular. Was in the right place. Didn't have any sharp edges. The 4 bolt holes also lined up exactly and were the right size. Bare metal was painted in the exact same colour as the case. He wouldn't know where to start but fully understood what he wanted and may have understood what was needed, metal removed, holes drilled but neither had the tools nor skills to be able to do it and especially to that standard. And even with some (irregular) practice, may never have those skills? ;-( and had never programmed in C or C++ before. Ok. I read an Arduino programming guide during my lunchbreaks Now that would never work for me. If I read something like that, it would pretty well instantly vanish from my mind / memory. Feck, I can't even remember a car reg from outside the house to walking in a writing it down somewhere. ;-( I would however remember that it was a blue Focus, that the n/s/f wheel trim was very wobbly, the n/s/r tyre was very soft and that it sounded like the exhaust manifold gasket was blowing. I would see / hear all those things without actually looking and remember them days later. and tried a couple example programs and a few tweaks to them over a couple of nights and then, dived into programming an 800 line control of a stepper motor driven model railway turntable with programmable selection of number of tracks, positions, auto-homing, reversal, shortest route, shortest route with reversal, acceleration/deceleration, speed control, EEPROM storage of settings, LCD display and pushbutton control. He he. Like I said, we have *completely* different skill sets Steve. ;-) I just did it by breaking it up into numerous functions and getting one at a time working. Ok, I *can* generally do that. Where a function depended upon another that I hadn't written yet, I just put in a few lines of dummy code to return a value or display something and coded that function later. And I've done that as well (inc making it a semi random value to simulate real live data). ;-) Cheers, T i m p.s. I was working on a similar setup to yours for my BIL's model railway. The idea was to give him something to run autonomously round the outside of his pretty large loft layout while he was doing / building stuff himself. The idea was a single line with two sidings at each end and 3 locos available. The 'system' would check for vacancy / occupancy of the sidings and the 3 sections of the main run (current pulse in the power feed line). Once all 3 locos were in their sidings (pulsed IR opto-reflective sensors under the end of the siding for position), a random siding was selected from the double occupied end, the points set at both ends to give a clear route to the empty siding at the other and the loco driven with full inertia during both acceleration and deceleration to the opto sensor at the destination (the deceleration would start as the loco entered the end section of the main line (current detection) and then the loco would finally crawl to the final opto sensor). [1] I had a good idea of how we could do it all, I had the PWM loco drive, points switching (electronic bridge), current measurement and opto sensors working ... and even a small shunter running up and down a test track (coming back via a passing loop) but didn't get the chance to do any more than test the basics on BIL's layout (and discovered how different the performance was for different models) before he moved. That said, I'm not sure I would have ever been able to do the coding required to pull it all together (inc the interactive bit, like 'How many locos do you want to run'?'). ;-( That's because I'm a support / electronics guy, not a designer or programmer. ;-) [1] Whilst the straight PWM speed control worked, it was soon obvious that feedback was required (to both deal with a range of locos and different gradients etc) so the next step was to use the Arduino to drive a dedicated / full-feedback speed controller. I actually have the PCB and components to build one that has a good rep but automating it was going to require a bit more effort (other than switching in straight presets (max speed, min speed, inertia etc)). |
#94
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Sun, 22 Oct 2017 09:56:53 +0100, The Natural Philosopher
wrote: He may well have or moved it inadvertently but even so I should be able to undelete it I thought. Why would you think that? Because I have run some undelete utilities before and if DD is a bit for bit copy and the sector hasn't been overwritten it should still be there, or is that hoping too much? AJH |
#95
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Thu, 26 Oct 2017 17:36:45 +0100, news wrote:
On Sun, 22 Oct 2017 09:56:53 +0100, The Natural Philosopher wrote: He may well have or moved it inadvertently but even so I should be able to undelete it I thought. Why would you think that? Because I have run some undelete utilities before and if DD is a bit for bit copy and the sector hasn't been overwritten it should still be there, or is that hoping too much? Was that on Linux/UNIX? -- My posts are my copyright and if @diy_forums or Home Owners' Hub wish to copy them they can pay me £1 a message. Use the BIG mirror service in the UK: http://www.mirrorservice.org *lightning surge protection* - a w_tom conductor |
#96
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 26 Oct 2017 20:24:20 GMT, Bob Eager wrote:
On Thu, 26 Oct 2017 17:36:45 +0100, news wrote: On Sun, 22 Oct 2017 09:56:53 +0100, The Natural Philosopher wrote: He may well have or moved it inadvertently but even so I should be able to undelete it I thought. Why would you think that? Because I have run some undelete utilities before and if DD is a bit for bit copy and the sector hasn't been overwritten it should still be there, or is that hoping too much? Was that on Linux/UNIX? No it was a usb stick under Windows XP AJH |
#97
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Thu, 26 Oct 2017 21:27:13 +0100, news wrote:
On 26 Oct 2017 20:24:20 GMT, Bob Eager wrote: On Thu, 26 Oct 2017 17:36:45 +0100, news wrote: On Sun, 22 Oct 2017 09:56:53 +0100, The Natural Philosopher wrote: He may well have or moved it inadvertently but even so I should be able to undelete it I thought. Why would you think that? Because I have run some undelete utilities before and if DD is a bit for bit copy and the sector hasn't been overwritten it should still be there, or is that hoping too much? Was that on Linux/UNIX? No it was a usb stick under Windows XP Ah, therein lies your misunderstanding. The on-disk structures on Linux and UNIX systems are a lot more complex. It is a lot harder to find bits of files and stitch them together. The old FAT file system, used of USB sticks, is also a lot easier to do an undelete on than, say, NTFS. Not saying it isn't possible, but it's a lot more difficult. -- My posts are my copyright and if @diy_forums or Home Owners' Hub wish to copy them they can pay me £1 a message. Use the BIG mirror service in the UK: http://www.mirrorservice.org *lightning surge protection* - a w_tom conductor |
#98
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 25/10/2017 11:42, T i m wrote:
On Wed, 25 Oct 2017 00:12:20 +0100, Steve Walker wrote: snips for brevity after saving reply in my Arduino docs folder ;-) Again, whilst I sort of understand the words I'm not really sure how it would work ITRW. Like, if I define (declare?) a variable in the setup, isn't that variable open to use anywhere in the in the entire program? Can I define / declare a variable just within say a for - next loop and be able to re=-define / declare it again elsewhere, without it affecting the other one? They are defined in the function definition, eg: int get_key (int l_valid_keys) { // declare local variables int l_key_value, l_key_pressed = 0; boolean l_valid_key_pressed = false; // loop until a valid key is pressed while (!l_valid_key_pressed) { Ok, again, you may be overestimating how someone like me can make use of such information Steve. It would be like me saying to my 87 year old Mum, 'If the boiler doesn't light again, just take the cover off, drop the burner out of the way, remove the pilot jet and clean it and put it all back again and you should be good to go. Even if she understood all the words (and may have watched / helped me doing it years ago), does she have the strength, dexterity, tools (and experience using them to ensure things aren't sheared off by turning them the wrong way or over tightened etc) or eyesight to be able to complete the task? snip So I might read the local value of the voltage input pin, calculate the external voltage and have that value equal to 'InstantVolts' for example? Yes. But being hardcoded it only ever reads the one pin, does the one calculation and outputs the one variable, whereas if you define a funtion with parameters, it can be more flexible. Lets say that pins AN0 and AN1 have 0-5V signals on them, but you want them scaled 0-100% and 50 to 75mm: voltage_a = return_voltage (AN0, 0, 100) voltage_b = return_voltage (AN1, 50, 75) where voltage_a, voltage_b and the function return_voltage are all defined as integers. And you can drop that function into other programs without problems, because none of the internal workings and variable are exposed to the rest of the program. Ok, again, I sorta understand the principles of what you are saying but not sufficiently ... and especially with my current 'offline' Arduino coding status to fully comprehend it's full meaning. It's like you are trying to give directions to someone in a foreign language where they get bits but wouldn't be able to repeat any of it even walk off in the right direction. ;-( The best thing is sketch out a basic outline of the program and then to have an Arduino hooked up or run a simulator program, so that you can throw simple code at it repeatedly until you iron out the bugs and then add a tiny bit more functionality and try again. Interactive development. It stops you writing too much in one go and then struggling to find the errors and you learn by doing. snip Although a completely different scenario, the following function is one I wrote to input a number and gives you an idea of reading buttons which you could incorporate into the main loop by simply putting the display and increment/decrement lines at the start or end of it and rely upon the main loop to keep iterating through it. int get_number_between_limits(int l_preset_value, int l_min_value, int l_max_value, int l_increment_size, String l_str1, String l_str2) { // declare local variables int l_value = l_preset_value; int l_key = 0; // loop until select key is pressed while (l_key != select) { // display current figure and command keys and wait for a keypress display_lcd (l_str1, String(l_value, DEC) + l_str2); l_key = get_key (up + down + (left + right) * (l_increment_size 1) + select); delay (200); // increment the counter by 1 or by larger increment if u or r respectively are pressed // decrement the counter by 1 or by larger increment if d or l respectively are pressed l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); l_value = l_value - (l_key == down && l_value l_min_value) - l_increment_size * (l_increment_size 1) * (l_key == left && l_value = l_min_value + l_increment_size); // end loop when select has been pressed } // return value return (l_value); } Wow. This is what I mean about not having the 'mind' for this sort of thing Steve. To me ... and even if I study just one line (other than the comments g) it could nearly be some form of hieroglyph. I see the very general thing each bit is doing but I wouldn't even have the first clue about writing it from scratch myself. I will have started that as a basic function that just returned a fixed value, so as to test other parts of the program that rely on it. Then I'll have added functionality for adding or subtracting 1 according to Up or Down button press and returning it when Select is pressed. Next will have been adding limits. Then adding larger jumps when Left and Right are pressed. Then adjusting the limit checking to allow for the larger jumps. On to adding displaying the value. So all developed in small chunks. It does look quite complicated. But if you can get your head around binary and basic boolean logic it becomes quite simple. It is that step that is the problem. It is one of those things that is difficult to grasp, but then just clicks. For instance: l_key = get_key (up + down + (left + right) * (l_increment_size 1) + select); looks complicated. But when you know that up, down, left, right and select are constants with the values 1, 2, 4, 8 and 16 and are passed to the get_key function to tell it which keys to accept as valid (the LCD board has 5 buttons), you can see that this call always allows up, down and select, but only accepts left or right if you have enabled larger jumps (ie: the increment size is greater than one). and: l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); looks really complicated. But all it does is take the current value and add 1 or the larger jump depending which key was pressed and then only if the value won't go out of range. The trick is the logic. Just like BODMAS in normal maths, there is an order (brackets come before + or -, then , =, = or , then AND or OR, then comparison) the results are True or False. True has the value 1 and False is 0. So for the first bracket: if the Up key was pressed and the value is less than the maximum, True (1) is added, otherwise False (0) is. The second bracket is true if large jumps are enabled (l_increment_size is greater than 1). The third bracket is true if the Right key is pressed and the value won't go too high by adding the large jump. If the second and third brackets are True then the large jump is added (l_increment_size * True * True) otherwise 0. snip Yes, I think I have that already with my battery monitor, minus the manual input / threshold setting stuff. A loop that contains the reading of inputs and displaying the converted values they are supposed to represent seem to be doable (as I've done it), it's the making it 'interactive' bit I've stumbled on. Now I have had a multi-button type input pad working and displaying the name of which button I've pressed but again mostly plagiarise and with no idea how I would integrate that in my own program. With a RTOS, you don't have to integrate the two, you run both at once and one sets a variable which the other reads. So you only have to get each part working independently rather than integrating the two into a single program. But would that then allow the buttons to change things mid run when you didn't want them to? One program can allow a new value to be entered, but the other program only needs to read it when it wants to. Alternatively, one program can zero a flag and the other can only accept new entry when it is zero, then it sets the flag with the new value. The first program can see that it is no longer 0 and knows a new value is available for reading whenever it wants. Then it can zero it if a new value is to be allowed again. snip Ok, say I write a voltmeter 'loop'. Reads the value on a pin, does the translation, displays the massaged value on a 4 x 16 lcd display. Then I want to add to that a current reading, I simply slip that inside the loop at the bottom and the loop now contains both routines (it might pause for one second to give you chance to read the values then clear the value fields just before updating them again, so you don't get any orphaned characters etc). Yes, but don't bother clearing them, just pad with spaces so that each new value displayed completely overwrites the previous one. Sorry, I think that's what I meant I did, so had to adjust the number of spaces dynamically to deal with the range of digits being displayed. Even that took an age to work out as for me, most of it is trial and error (which is also fart of the frustration). Trial and error is fine. That's how I started doing my Arduino programming. With practice, I can now write whole sections of program (say in my lunchbreak at work) in a text editor and just iron out a few bugs later when I can actually test it. But say I wanted to watch for a particular voltage trend - threshold (low battery level) (easy, just include that check at the bottom of my loop) and then say sound an alarm for 5 seconds (easy if the previous check was part of an If-then loop) then shut off the alarm and release a relay ... then continue to display the voltage but otherwise 'stop', it's knowing 'how' one should construct a solution? eg. I have previously programmed steps manually that I know could be in a loop but the means of looping them escape me (and I have had running LEDS going up and down and looping and all flashing etc, and using loops, albeit, mostly cribbed them massaged etc). If I understand what you are saying, a simple loop that never ends, a boolean variable (say alarm_tripped) set to true before the loop and set to false at the same time as you start the alarm sounding. Just put the alarm checking and sounding in an IF statement controlled by alarm_tripped. Once the alarm trips, the loop continues running and so reads the voltage and displays it, but no longer monitors the threshold or sounds the alarm. Ok, I sort of follow that, logically if not what it would require exactly coding-wise. ;-) snip Quite, and little of 'picking up Windows' involves dropping to the CLI and typing gobbledygook where the typing accuracy has to be 100% (even to the case etc!), let alone the command and syntax. In the most part, Windows can be explored (because most things can be done in the GUI), Linux needs to be learned. To be fair, I started with ZX-81s, Spectrums, QLs and then PC-DOS/MS-DOS, so command line came first for me. As did I, but there are only a few CLI instructions you need and most only require some modifiers, rather that actually creating a script or program as such. c:\datacopy *.* c:\backup /e/v/s (from memory) might be as complex as I got? Do you also remember DEBUG g=c800:5 There are many things that need command line access in Windows, but often for tweaks that many users won't need. Quite, or even know exist and yet can still fully maintain their systems. snip The frustrating thing for me is I love the whole Arduino thing (for the reasons you state),I like all the electronics stuff and I have loads of projects in mind using them and even have the (Arduino powered) 3D printer to print bits for any project I build ... it's just I know the chances are I wouldn't have the time, patience or confidence to complete the coding bit ... so the parts just sit here. ;-( As you say, I may have more of an aptitude for programming than you, but I haven't seriously programmed for years But that suggests you have 'seriously programmed' at some point whereas I never have. And this seems to be common amongst the Linux Geeks who 'assume' everyone can understand such things as easily as they can. I use Linux and have a Linux home server, but I know only the very basics and look up anything I need online. I am much more at home with Windows. I played with the ZX-81 and Spectrum and then took O-level Computer Studies, programming my project in QL SuperBasic (I did manage to sell the program to QL World magazine later). As a student I played with Turbo Pascal on the PC and used it to do the few computing assignments that we were given (it was an Engineering degree, not a computing one). I also used Forth to control some motors and sensors on an automated forklift. After that I didn't do any programming for a few years, although I did write specifications and flow-charts for others to design industrial control programs from and then tested the operation. In 1996/7 and 1997/8 I did a part-time MSc in Computing - which was much more about gathering user requirements, specifying systems, creating databases, etc. and very little real programming. I did the first 2/3 of the course and only had the project to complete (networking in Linux), but I abandoned it as I got together with my future wife and within weeks her father was diagnosed with advanced and terminal cancer. I did do some basic PLC ladder-logic programming on and off, but only minor stuff. Then nothing again for years. More recently I've been testing PLC/SCADA systems, identifying (and in some cased correcting) errors in a combination of ladder logic and functional blocks (like a flowchart). Until recently I was again specifying PLC programs, although not actually writing them. Now I am checking other people's specifications. My background is actually much more in industrial control panels, actuated valves, instrumentation, motor control centres and field cabling. The hardware and logic, but not the programming. That is why Arduino programming comes pretty easily to me. I am comfortable with the logic rather than the complexities of user interfaces under Windows or Linux. I cut a hole for a fan in the side of a steel PC case for a geeky mate and he couldn't understand how the hole was: The exact right size. Was completely circular. Was in the right place. Didn't have any sharp edges. The 4 bolt holes also lined up exactly and were the right size. Bare metal was painted in the exact same colour as the case. He wouldn't know where to start but fully understood what he wanted and may have understood what was needed, metal removed, holes drilled but neither had the tools nor skills to be able to do it and especially to that standard. And even with some (irregular) practice, may never have those skills? ;-( and had never programmed in C or C++ before. Ok. I read an Arduino programming guide during my lunchbreaks Now that would never work for me. If I read something like that, it would pretty well instantly vanish from my mind / memory. Feck, I can't even remember a car reg from outside the house to walking in a writing it down somewhere. ;-( I would however remember that it was a blue Focus, that the n/s/f wheel trim was very wobbly, the n/s/r tyre was very soft and that it sounded like the exhaust manifold gasket was blowing. I would see / hear all those things without actually looking and remember them days later. I'd struggle with the number (and people's names and faces). and tried a couple example programs and a few tweaks to them over a couple of nights and then, dived into programming an 800 line control of a stepper motor driven model railway turntable with programmable selection of number of tracks, positions, auto-homing, reversal, shortest route, shortest route with reversal, acceleration/deceleration, speed control, EEPROM storage of settings, LCD display and pushbutton control. He he. Like I said, we have *completely* different skill sets Steve. ;-) I just did it by breaking it up into numerous functions and getting one at a time working. Ok, I *can* generally do that. Where a function depended upon another that I hadn't written yet, I just put in a few lines of dummy code to return a value or display something and coded that function later. And I've done that as well (inc making it a semi random value to simulate real live data). ;-) Cheers, T i m p.s. I was working on a similar setup to yours for my BIL's model railway. The idea was to give him something to run autonomously round the outside of his pretty large loft layout while he was doing / building stuff himself. The idea was a single line with two sidings at each end and 3 locos available. The 'system' would check for vacancy / occupancy of the sidings and the 3 sections of the main run (current pulse in the power feed line). Once all 3 locos were in their sidings (pulsed IR opto-reflective sensors under the end of the siding for position), a random siding was selected from the double occupied end, the points set at both ends to give a clear route to the empty siding at the other and the loco driven with full inertia during both acceleration and deceleration to the opto sensor at the destination (the deceleration would start as the loco entered the end section of the main line (current detection) and then the loco would finally crawl to the final opto sensor). [1] A nice little system. I had a good idea of how we could do it all, I had the PWM loco drive, points switching (electronic bridge), current measurement and opto sensors working ... and even a small shunter running up and down a test track (coming back via a passing loop) but didn't get the chance to do any more than test the basics on BIL's layout (and discovered how different the performance was for different models) before he moved. That said, I'm not sure I would have ever been able to do the coding required to pull it all together (inc the interactive bit, like 'How many locos do you want to run'?'). ;-( LCD shield; LCD library lets you display a prompt; pressing one of the buttons selects how many locos. That's because I'm a support / electronics guy, not a designer or programmer. ;-) [1] Whilst the straight PWM speed control worked, it was soon obvious that feedback was required (to both deal with a range of locos and different gradients etc) so the next step was to use the Arduino to drive a dedicated / full-feedback speed controller. I actually have the PCB and components to build one that has a good rep but automating it was going to require a bit more effort (other than switching in straight presets (max speed, min speed, inertia etc)). I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). SteveW |
#99
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Fri, 27 Oct 2017 00:20:43 +0100, Steve Walker
wrote: snip Ok, again, I sorta understand the principles of what you are saying but not sufficiently ... and especially with my current 'offline' Arduino coding status to fully comprehend it's full meaning. It's like you are trying to give directions to someone in a foreign language where they get bits but wouldn't be able to repeat any of it even walk off in the right direction. ;-( The best thing is sketch out a basic outline of the program and then to have an Arduino hooked up or run a simulator program, so that you can throw simple code at it repeatedly until you iron out the bugs and then add a tiny bit more functionality and try again. Interactive development. Again, it *sounds* easy enough and can be, even for me but only when using very basic 'maths'. It stops you writing too much in one go and then struggling to find the errors and you learn by doing. Whilst you / one can, you only can when you actually fix the broken bits. Often the only way I can fix my attempts at doing something from scratch is to find someone else's code and try to make that do what I want. To be able to do this stuff you have to know the tools *and* how to use them and I don't past a very basic level and don't remember what I have actually done the next day. ;-( snip mad code example Wow. This is what I mean about not having the 'mind' for this sort of thing Steve. To me ... and even if I study just one line (other than the comments g) it could nearly be some form of hieroglyph. I see the very general thing each bit is doing but I wouldn't even have the first clue about writing it from scratch myself. I will have started that as a basic function that just returned a fixed value, so as to test other parts of the program that rely on it. Then I'll have added functionality for adding or subtracting 1 according to Up or Down button press and returning it when Select is pressed. Next will have been adding limits. Then adding larger jumps when Left and Right are pressed. Then adjusting the limit checking to allow for the larger jumps. On to adding displaying the value. So all developed in small chunks. Again, I understand the theoretical logic / principals, it's translating that into actual code that I struggle with. It does look quite complicated. But if you can get your head around binary and basic boolean logic it becomes quite simple. Ah ... and that is the big *IF* Steve. ;-( It is that step that is the problem. Like I mentioned previously ... not only do I have to deal with constructing the code, by creating and entering it by hand using a keyboard (rather than clicking on something), I *also* have to deal with the maths. It is one of those things that is difficult to grasp, but then just clicks. Or doesn't ... remembering I've been tinkering with such over a long period now (inc many many hours after classes at college (where I was on a Trans Ed course [1]) on a DecWriter into a PDP11 over a 300 baud modem). For instance: l_key = get_key (up + down + (left + right) * (l_increment_size 1) + select); looks complicated. But when you know that up, down, left, right and select are constants with the values 1, 2, 4, 8 and 16 and are passed to the get_key function to tell it which keys to accept as valid (the LCD board has 5 buttons), you can see that this call always allows up, down and select, but only accepts left or right if you have enabled larger jumps (ie: the increment size is greater than one). Ok, when I look at that and even after reading your explanation a couple of times I have to trust that what you say is in fact true / correct (I do of course). What I mean is it would be like someone teaching you a foreign language when the word they tell you means 'wheelbarrow', really means that because there is no parallel that could be naturally drawn from said word in that language. Therefore, if you try to do back to it later, there is no logical link (outside of just remembering it) to help you on your way. and: l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); looks really complicated. But all it does is take the current value and add 1 or the larger jump depending which key was pressed and then only if the value won't go out of range. Again, I could consider that section for ever and never be able to reproduce it myself. Not only because of my memory, not only because of my maths, but because of all of the programming tools that don't relate to anything I have ever been party to ITRW (like && etc). The trick is the logic. Just like BODMAS in normal maths, there is an order (brackets come before + or -, then , =, = or , then AND or OR, then comparison) the results are True or False. True has the value 1 and False is 0. I just about get / use BODMAS but that was about as far as my 'maths' ever went. So for the first bracket: if the Up key was pressed and the value is less than the maximum, True (1) is added, otherwise False (0) is. The second bracket is true if large jumps are enabled (l_increment_size is greater than 1). The third bracket is true if the Right key is pressed and the value won't go too high by adding the large jump. If the second and third brackets are True then the large jump is added (l_increment_size * True * True) otherwise 0. OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. If it didn't work, and even with your explanation, the only chance I'd be able to spot the error is if the IDE highlighted the line *and* I could see the error visually (rather than logic or maths) by say the lack of symmetry. If I take a complex machine to pieces the parts themselves often 'talk to me' in that I can see which was round a washer sat by the markings of the parts that were sat either side of it. I get no such clues from coding ... it is a form of blindness for me. snip But would that then allow the buttons to change things mid run when you didn't want them to? One program can allow a new value to be entered, but the other program only needs to read it when it wants to. Ok. Alternatively, one program can zero a flag and the other can only accept new entry when it is zero, then it sets the flag with the new value. The first program can see that it is no longer 0 and knows a new value is available for reading whenever it wants. Then it can zero it if a new value is to be allowed again. Ok, I get the logic on that at least. ;-) snip? Trial and error is fine. That's how I started doing my Arduino programming. With practice, I can now write whole sections of program (say in my lunchbreak at work) in a text editor and just iron out a few bugs later when I can actually test it. Ok, I can do similar BUT only when it's a straight 'electronic routine that requires no, or very little maths. Eg, read the value from a pot, massage that value a bit (multiply by a constant typically) then output that value on a display. That's about my lot. snip As did I, but there are only a few CLI instructions you need and most only require some modifiers, rather that actually creating a script or program as such. c:\datacopy *.* c:\backup /e/v/s (from memory) might be as complex as I got? Do you also remember DEBUG g=c800:5 Erm, accessing the ROM on a drive controller to start a LL format? (truly from memory)? I did edit HEX code on some EPROM data but only parrot fashion when instructed by the devs etc (test bugfixes / patches etc).. snip But that suggests you have 'seriously programmed' at some point whereas I never have. And this seems to be common amongst the Linux Geeks who 'assume' everyone can understand such things as easily as they can. I use Linux and have a Linux home server, but I know only the very basics and look up anything I need online. Ok. I am much more at home with Windows. As am I, particularly that most things can generally be resolved from within the GUI when one can *explore* rather than having to *know* what to type. I played with the ZX-81 and Spectrum and then took O-level Computer Studies, programming my project in QL SuperBasic (I did manage to sell the program to QL World magazine later). Neat! About the same time then I would be using them to play games of building electronic interfaces for them or re-casing them with proper keyboards etc. As a student I played with Turbo Pascal on the PC and used it to do the few computing assignments that we were given (it was an Engineering degree, not a computing one). I also used Forth to control some motors and sensors on an automated forklift. I only did the first year on an Electrical Engineering OND but then it got too abstract for me. After that I didn't do any programming for a few years, although I did write specifications and flow-charts for others to design industrial control programs from and then tested the operation. Again, I've never done any of that, never even created a spreadsheet etc. In 1996/7 and 1997/8 I did a part-time MSc in Computing - which was much more about gathering user requirements, specifying systems, creating databases, etc. and very little real programming. But still requiring a detailed and logical approach to it all? By then I was doing bench electronics repair for the GPO. ;-) I did the first 2/3 of the course and only had the project to complete (networking in Linux), but I abandoned it as I got together with my future wife Quite .. and I was building a mobile disco and co designing and doing all the building for various light sequencers etc. and within weeks her father was diagnosed with advanced and terminal cancer. Ah, sorry to hear that mate. A girlfriend at the time was about to move in with me when she had to do the same with her Dad (and stayed 'up norf' to look after her Mum and siblings etc). I did do some basic PLC ladder-logic programming on and off, but only minor stuff. But again, at least it was programming? I was building a and racing RC cars and boats, expanding the disco, rebuilding motorbikes and cars and trying to keep the girlfriend at the time entertained at the same time. ;-) Then nothing again for years. But it's like learning how to ride a bike ... once learned ... ? More recently I've been testing PLC/SCADA systems, identifying (and in some cased correcting) errors in a combination of ladder logic and functional blocks (like a flowchart). Until recently I was again specifying PLC programs, although not actually writing them. Now I am checking other people's specifications. So *still* involved in logic, programming and control. My background is actually much more in industrial control panels, actuated valves, instrumentation, motor control centres and field cabling. The hardware and logic, but not the programming. But still the 'logic'. ;-) That is why Arduino programming comes pretty easily to me. I am comfortable with the logic rather than the complexities of user interfaces under Windows or Linux. Understood. snip I would however remember that it was a blue Focus, that the n/s/f wheel trim was very wobbly, the n/s/r tyre was very soft and that it sounded like the exhaust manifold gasket was blowing. I would see / hear all those things without actually looking and remember them days later. I'd struggle with the number (and people's names and faces). Ok. I'm 'not bad' with 'easy' faces and have to make an effort with names (some coming easier than others). I tend to apply a 'am I likely to need to remember their name for the future' test and then make an effort to remember it if I think I might. When I was an IT trainer and seeing ~8-10 different people for 5 days it was lucky if I could name them all by the end of the week and would have forgotten most by the week after. But that was why I gave them all name cards. ;-) snip The idea was a single line with two sidings at each end and 3 locos available. The 'system' would check for vacancy / occupancy of the sidings and the 3 sections of the main run (current pulse in the power feed line). Once all 3 locos were in their sidings (pulsed IR opto-reflective sensors under the end of the siding for position), a random siding was selected from the double occupied end, the points set at both ends to give a clear route to the empty siding at the other and the loco driven with full inertia during both acceleration and deceleration to the opto sensor at the destination (the deceleration would start as the loco entered the end section of the main line (current detection) and then the loco would finally crawl to the final opto sensor). [1] A nice little system. I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( snip That said, I'm not sure I would have ever been able to do the coding required to pull it all together (inc the interactive bit, like 'How many locos do you want to run'?'). ;-( LCD shield; LCD library lets you display a prompt; pressing one of the buttons selects how many locos. You make all sound so easy Steve. ;-) So my interest was electronics and then bled over into computing, not the other way round. Now my interest is mostly just using a computer as an appliance, but I still don't mind doing some hardware stuff (again, only practical stuff, no LED lit cases and fans etc) and trying say Linux, just to see how far it has come on (I'm not that interested in OSX because I can't (officially / easily) run it on std IBM PC Clone hardware and I only have 5 Macs here). ;-) I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. He didn't want to have to 'program' anything to make it run. So this automated bit was just going to be an addition to his existing old-skool manual running etc. Cheers, T i m [1] I left school when I was 15 (August birthday) and went and did a 'Trans Ed' course at a local Technical College. O level English, Physics, Maths and Technical Drawing in the mornings, with practical stuff all afternoon (Electrical Engineering, Workshop Practice, Catering, Automobile Engineering and Welding / fabrication). Many people I knew and know who weren't overly academic would have loved / love to go on such a world-experience useful course. What at the College I gained access to the 'Computer Room' and would often be online from the end of the last class till the caretaker chucked me out at 9pm. If the Decwriter ever went wrong on another 'Computer' course, *I* would be found in the college and requested (sometimes pulling me out of class) to go and fix it. ;-) |
#100
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/17 09:50, T i m wrote:
OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. That is why when starting to code, its best to use the simplest constructions that you know and already have learnt. e.g. if(key==UP) keyvalue = keyvalue+1; else if(key==DOWN) keyvalue = keyvalue-1; Is going to end up - with a decent compileer, as the same as: keyValue +=(key==UP? 1: (Key==DOWN? -1:0)); or any other arcane way of saying the same thing All coding is is telling a very very stupid machine, but one that can do what its told very fast, exactly what to do in every single circumstance. Learning the language is really all coding is. The original Kernighan and Ritchie was a slim volume that defined ALL you needed to know about the C language at that time. And there wasn't a great deal of it. The other half of programming, - breaking the problem down into a simple set of procedural steps that the computer CAN do, is the same in any language. As I learnt assumebler first of all, and assembler is completely acrane and deals with registers and not usually specific named variables - though thiose can exist - I used to swit down FIRTS and wriore a huge blkock of TEXT as a 'comment' that would explain WTF the following 20 lines of Assemblers were supposed to do. i.e. ; the current keypress values isn in the accumulator (A) ; compare it with the expected value of up, ; and if true increment the variuable KeyValue by one. ; otherwise compare with down ; and if true decrement the keyValue variable ; otherwise do feck all. ; alters: Register B, used as temp keyvalue variable. ; MOV B, KEYVALUE ; load existing key value into B CMP A, #UP ; if 'UP' inc B JE KEYUP CMP A, #DOWN ; if 'DOWN' dec B JNE NOWT ; otherwise do sod all DEC B JMP NOWT ; tidy up and go KEYUP: INC B NOWT: MOV KEYVALUE, B ; save new key value into variable. The beauty of C is you can write the same logic MUCH faster because the compiler takes care of the rergisters, and the crude memory movements. -- Climate Change: Socialism wearing a lab coat. |
#101
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 00:20, Steve Walker wrote:
I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). I am thinking of doing the same 8-) I have the stepper, motor shield and arduino. I think I need a reduction gear as the 1.8 degree steps are too coarse and micro stepping doesn't improve precision. Maybe I could get away with a 0.9 degree motor and half steps? So basically whizz around until you find the optical switch so you know where you are. Add some code to step until the tracks line up and store the values in eprom of some sort. one off so it doesn't need to be kept in the main code. Next the hard bit, decide what dcc commands to select the track and which direction to turn it. Its a bit on hold ATM until I see what happens with the chemo. |
#102
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Fri, 27 Oct 2017 09:50:28 +0100, T i m wrote:
On Fri, 27 Oct 2017 00:20:43 +0100, Steve Walker I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. He didn't want to have to 'program' anything to make it run. So this automated bit was just going to be an addition to his existing old-skool manual running etc. Are either of you aware of these people? https://www.merg.org.uk/ Lots of infomation,advice,ideas and hardware available to members. I've been tempted to join myself but never found I do enough to really justify it. G.Harman |
#103
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Fri, 27 Oct 2017 10:21:45 +0100, The Natural Philosopher
wrote: On 27/10/17 09:50, T i m wrote: OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. That is why when starting to code, its best to use the simplest constructions that you know and already have learnt. But that is the issue mate ... I'm both too old and not suitably wired to believe I know or have learned any of it. I think the best I could say is that 'more of it is un-tangle able to me now'. Now, by 'know' / 'learned' I would take that mean that one would probably expect to be able to start with a clean page and create something functional from scratch. I couldn't do that. e.g. if(key==UP) So, what does '==' mean? OK, 'of course' I could look it up or pick it up from an example but at what people would you think someone *not* familiar with such things would 'understand / know / remember' to use such things, when say not doing any of it for 6 months? By comparison, I could go back to my MIG welder after not welding for several years and be able to set it up to give a good weld without having to refer to any reminders etc. And how does it know what the UP key is or how to know what to read that is supposed to represent it? What I'm saying there (and I appreciate you may have left such things out for brevity or because they weren't relevant for this example) is there is often loads of preamble before the functional code itself is even considered. keyvalue = keyvalue+1; else if(key==DOWN) keyvalue = keyvalue-1; Is going to end up - with a decent compileer, as the same as: keyValue +=(key==UP? 1: (Key==DOWN? -1:0)); or any other arcane way of saying the same thing To me, they are both just hieroglyphics. ;-) Again, I'm not saying that if I didn't pour over them for an evening and play with them in a program I wouldn't see how things changed etc, just that even if I did ... and with everything else I'm doing and trying to get done right now, I am 100% sure I would have forgotten it all the next day. ;-( All coding is is telling a very very stupid machine, but one that can do what its told very fast, exactly what to do in every single circumstance. Understood. Learning the language is really all coding is. Ah, another thing that it would be very difficult for me to do these days, at my age with my memory and wiring. What I mean by the last bit is that I can and do pick up new stuff ... and remember it all the time, but only from within a type of stuff that I have already had an interest in over a long period or is very similar to something that fits that same bill. The original Kernighan and Ritchie was a slim volume that defined ALL you needed to know about the C language at that time. And there wasn't a great deal of it. But that would mean me knowing what to look for and remembering what I found every time I wanted to do something. It's like you being introduced to someone who is called Fred or being introduced to someone who's name you haven't ever seen or heard of before and may not use spelling or pronunciation that you are familiar with either. If you have a good ear and an eidetic memory it probably wouldn't be an issue but the chances are that I would be fluffing about using more general terms for them so as not to embarrass either of us (or quietly ask someone else and try to practice it but again, would probably forget by the next week). I might still remember 'Fred' months later though. The other half of programming, - breaking the problem down into a simple set of procedural steps that the computer CAN do, is the same in any language. Understood ... and I understand the concepts, just as I understand say the (very) basics / concepts of how a nuclear power plant works, but I couldn't go into any detail. As I learnt assumebler first of all, and assembler is completely acrane and deals with registers and not usually specific named variables - though thiose can exist - I used to swit down FIRTS and wriore a huge blkock of TEXT as a 'comment' that would explain WTF the following 20 lines of Assemblers were supposed to do. ;-) i.e. ; the current keypress values isn in the accumulator (A) ; compare it with the expected value of up, ; and if true increment the variuable KeyValue by one. ; otherwise compare with down ; and if true decrement the keyValue variable ; otherwise do feck all. ; alters: Register B, used as temp keyvalue variable. Ok, I *can* see how if you commented to that level it would at least explain stuff that you went back to the next day. It was strange, sometimes when answering questions as an IT Instructor I would deeper consider things I previously had not. eg, Explaining something you may do intuitively sometimes helps you learn / consider it yourself. ;-) ; MOV B, KEYVALUE ; load existing key value into B CMP A, #UP ; if 'UP' inc B JE KEYUP CMP A, #DOWN ; if 'DOWN' dec B JNE NOWT ; otherwise do sod all DEC B JMP NOWT ; tidy up and go KEYUP: INC B NOWT: MOV KEYVALUE, B ; save new key value into variable. The beauty of C is you can write the same logic MUCH faster because the compiler takes care of the rergisters, and the crude memory movements. Ok. I think I am going to have to deeper resign myself that I really am not cut out for coding (and never have been) and being realistic, it isn't something that I have the time for either (especially given everything else I want / need to do). The *only* reason I am dealing with it at all is because I would like to make things that I could use to benefit me, to use as tools (battery discharge loggers / LVD etc) and cheaply. I *like* doing the electronics side because I can and can generally do so quickly and easily. I also know when I have made a good job of it. I prefer 'home made' solutions because I can often easier make them do more of what I want and can repair them if / when they break or get damaged. I would much rather say turn something on my lathe that someone needed in return for them doing some coding (even if it took me more time than they spent) than waste the same amount of time wandering about dazed and confused and trying to do something outside my current (or feasible) skill set. It's just the same as how an OS is to me *just* a way of me being able to make use of the hardware, to make it do what I need or building a kitcar was to me interest in having something that I could run and maintain cheaply and that didn't need re-welding at every MOT (as cheaper vehicles often did in those days). We built it ~30 years ago now and I've not had to weld anything on it yet! ;-) It's back to YMMV etc. ;-) Thanks for the thoughts though, they are appreciated. Cheers, T i m |
#104
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Fri, 27 Oct 2017 11:23:02 +0100, T i m wrote:
To me, they are both just hieroglyphics. ;-) Again, I'm not saying that if I didn't pour over them for an evening and play with them in a program I wouldn't see how things changed etc, just that even if I did ... and with everything else I'm doing and trying to get done right now, I am 100% sure I would have forgotten it all the next day. ;-( Perhaps I should send you my lecture notes. As in, the ones I wrote. -- My posts are my copyright and if @diy_forums or Home Owners' Hub wish to copy them they can pay me £1 a message. Use the BIG mirror service in the UK: http://www.mirrorservice.org *lightning surge protection* - a w_tom conductor |
#105
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Fri, 27 Oct 2017 11:23:02 +0100, T i m wrote:
Now, by 'know' / 'learned' I would take that mean that one would probably expect to be able to start with a clean page and create something functional from scratch. I couldn't do that. I've had many students who believd that too. The key is to decouple the solution from the programming. Write out the solution in detail (in whatever language you usually use, probably English). Get that right, to your satisfaction. Then use that as a template to write in whichever language you wish (forget object-oriented at this stage). C, assembler, whatever. We are often asked by applicants "What language do you use?" and the answer is "Mainly English". The programming language is merely the last stage. -- My posts are my copyright and if @diy_forums or Home Owners' Hub wish to copy them they can pay me £1 a message. Use the BIG mirror service in the UK: http://www.mirrorservice.org *lightning surge protection* - a w_tom conductor |
#107
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27 Oct 2017 10:32:01 GMT, Bob Eager wrote:
On Fri, 27 Oct 2017 11:23:02 +0100, T i m wrote: Now, by 'know' / 'learned' I would take that mean that one would probably expect to be able to start with a clean page and create something functional from scratch. I couldn't do that. I've had many students who believd that too. Then we may have a different understanding of those terms then Bob (assuming that point was included in your reply). ;-) I wouldn't expect anyone who had learned a skill or trade to have to refer to the translations or instructions every time they did some bread_and_butter job? The key is to decouple the solution from the programming. Write out the solution in detail (in whatever language you usually use, probably English). Or a form of ... ;-) Get that right, to your satisfaction. Ok. That I could probably do. Then use that as a template to write in whichever language you wish (forget object-oriented at this stage). C, assembler, whatever. I don't 'wish' to write it in any (other) language at all Bob. I'd like (in 2017) to be able to describe what I want to do in English and have 'the program' work out the code for me. ;-) We are often asked by applicants "What language do you use?" and the answer is "Mainly English". ;-) The programming language is merely the last stage. And for me where most such projects stall. That's not completely true. I can sometimes make the more straightforward stuff work but would like to have it more interactive. Like, I could get an Arduino to read a voltage and disconnect (itself and the load) when the voltage dropped below a preset threshold but I might like it to also log the discharge to an SD card, raise an alarm (for a finite time) and allow me to tweak some of the variables (like how much load to switch in or what the cutoff voltage should be etc). The thing is, I'm not sure how / if the code relates to the order of events that I have in my plain English list. When I was a field support electronics / datacomms guy, we bought a turn-key call logging package. We would ask for a field to be changed to suit our needs and they would do it in a day and charge us £100. another and similarly *simple* (to us) change might take them two weeks and cost us £1000? Only they would know why and I suspect it all depended on what needed to be done in the background ... just changing some text in a field name or re-writing a database lookup or conversion etc. For *me* to go from my simple English list to something that works to the same spec could involve many techniques that I'm completely unfamiliar with and possibly catering for something I put at the end, right at the beginning. If I wanted to build a kitcar I knew, without ever building one before, exactly what would be expected of me before I even started. I knew because I had done (and was competent in) most of the things I was going to need to do and so none of it was new and the workflow was very obvious (strip parts from donor, clean, refurbish, repaint, fit on kitcar etc). I'm in a similar position with most of the electronics required on most of my desired projects (well, I can't say even the project is desired, it's the final outcome I actually *want / need*), it's just that I realise / appreciate how easy the coding part makes (can make) such things (in many cases) over just using discrete electronics. Cheers, T i m |
#108
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 10:52, wrote:
On Fri, 27 Oct 2017 09:50:28 +0100, T i m wrote: On Fri, 27 Oct 2017 00:20:43 +0100, Steve Walker I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. He didn't want to have to 'program' anything to make it run. So this automated bit was just going to be an addition to his existing old-skool manual running etc. Are either of you aware of these people? https://www.merg.org.uk/ Lots of infomation,advice,ideas and hardware available to members. I've been tempted to join myself but never found I do enough to really justify it. G.Harman Yes thanks. I joined a while ago to buy a couple of their kits. My membership has lapsed now though. Although not yet in use, I have their DCC command station and handset. SteveW |
#109
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 10:49, dennis@home wrote:
On 27/10/2017 00:20, Steve Walker wrote: I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). I am thinking of doing the same 8-) I have the stepper, motor shield and arduino. Me too. I think I'm going to have to decorate the bathroom, plus the hall, stairs and landing before I can spend much time on it again though. I think I need a reduction gear as the 1.8 degree steps are too coarse and micro stepping doesn't improve precision. Maybe I could get away with a 0.9 degree motor and half steps? I am using a 0.9 - currently on 1/8th steps for smooth movement at low speed. I may have an advantage in that each step gives only a small physical movement at the periphery anyway, as it is an n-gauge turntable. I did consider gearing, but unless you invest in a pretty expensive zero-backlash gearbox, you'd have to double up the positions to allow for approach from both directions and then you'd still have the uncertainty of it moving about a bit afterwards. One of the commercial systems uses a toothed belt and wheels. So basically whizz around until you find the optical switch so you know where you are. It is set up to whizz round with full steps at speed, back up a bit, then creep back up before setting the zero. Probably unnecessary to do that, but it only takes a couple more seconds. Add some code to step until the tracks line up and store the values in eprom of some sort. one off so it doesn't need to be kept in the main code. Stored in the Arduino's own internal EEPROM, using the library functions to store and retrieve values. The first time the program runs it detects that the EEPROM is not programmed with the parameters (the parameters can also be erased from the LCD/Pushbutton user menu for future reprogramming) and runs the calibration routine. Each track is stored twice. Once for each end of the turntable bridge, to allow for any phsical irregularity. It asks how many tracks, gets you to line up the first, then the second, etc., once it has them all, it repeats with the other end of the bridge. Next the hard bit, decide what dcc commands to select the track and which direction to turn it. I already have working functions that, when told which end of the turntable bridge to use and which track to line up with, works out which direction is shortest and moves to it. Any time that it passes the optical switch, it takes the opportunity to make sure that the zero is still correct as well. Everything is working with the LCD and pushbuttons to control it, but I haven't added any DCC control yet - and yes, the user interaction and constraints of DCC functions have yet to be fully considered - one possibility is mapping of functions to tracks, reversal, etc., possibly pairs of functions in sequence if necessary. Another is using Arduinos as handsets and programming in specific extras to use the 128 speed steps as codes to cover all the options. Its a bit on hold ATM until I see what happens with the chemo. SteveW |
#110
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 22:05, Steve Walker wrote:
I am using a 0.9 - currently on 1/8th steps for smooth movement at low speed. The trouble is that while it makes the movement smoother it doesn't mean the motor will stop in the same place. Steppers really only do whole (double coil) or half (single coil) steps. Anything else is pretty well undefined. |
#111
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 26 Oct 2017 21:46:24 GMT, Bob Eager wrote:
Ah, therein lies your misunderstanding. The on-disk structures on Linux and UNIX systems are a lot more complex. It is a lot harder to find bits of files and stitch them together. The old FAT file system, used of USB sticks, is also a lot easier to do an undelete on than, say, NTFS. Not saying it isn't possible, but it's a lot more difficult. Thanks Bob but it is a usb3 1TB disc and was written from Windows 10. I didn't look to see the file type but had assumed it would still be FAT. I inspected it from MINT17 and have DDd a copy onto my hard drive. I'm still waiting for my brother to check his other files in case he has a recent version before figuring how to create a mount point and load the iso. I also previously approached a data recovery company which is 'phoning me two or three times a week, often the caller has no knowledge of previous conversations but subsequent to the call I get a text message and an e-mail asking me how their caller performed and spewing out the same details of their services. AJH |
#112
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 09:50, T i m wrote:
On Fri, 27 Oct 2017 00:20:43 +0100, Steve Walker wrote: Snip Interactive development. Again, it *sounds* easy enough and can be, even for me but only when using very basic 'maths'. It stops you writing too much in one go and then struggling to find the errors and you learn by doing. Whilst you / one can, you only can when you actually fix the broken bits. Often the only way I can fix my attempts at doing something from scratch is to find someone else's code and try to make that do what I want. To be able to do this stuff you have to know the tools *and* how to use them and I don't past a very basic level and don't remember what I have actually done the next day. ;-( Lots of comments - even to the extend of commenting every line in places. Snip It does look quite complicated. But if you can get your head around binary and basic boolean logic it becomes quite simple. Ah ... and that is the big *IF* Steve. ;-( It isn't intuitive, but it is simple - after all, everything only has two states, 1 (True) or 0 (False). There are very few things to learn. Logical operators that work on True or False values: && (AND) 0 && 0 = 0 0 && 1 = 0 1 && 0 = 0 1 && 1 = 1 ¦¦ (OR) 0 ¦¦ 0 = 0 0 ¦¦ 1 = 1 1 ¦¦ 0 = 1 1 ¦¦ 1 = 1 ! (NOT) !0 = 1 !1 = 0 Just the same as individual logic gates in digital electronics. Anything else can be made by combining them. and bitwise operators that work on complete bytes, words, etc. (I have used nybbles for simplicity): & (AND) 1010 & 0110 = 0010 ¦ (OR) 1010 ¦ 0110 = 1110 ~ (Complement) ~1010 = 0101 ^ (XOR) 1010 ^ 0110 = 1100 (Shift left) 1010 = 0100 (Shift right) 1010 = 0101 It is that step that is the problem. Like I mentioned previously ... not only do I have to deal with constructing the code, by creating and entering it by hand using a keyboard (rather than clicking on something), I *also* have to deal with the maths. I've not looked at it, but maybe Flowcode http://www.matrixtsl.com/flowcode/ might help you? Snip l_value = l_value + (l_key == up && l_value l_max_value) + l_increment_size * (l_increment_size 1) * (l_key == right && l_value = l_max_value - l_increment_size); looks really complicated. But all it does is take the current value and add 1 or the larger jump depending which key was pressed and then only if the value won't go out of range. Again, I could consider that section for ever and never be able to reproduce it myself. Not only because of my memory, not only because of my maths, but because of all of the programming tools that don't relate to anything I have ever been party to ITRW (like && etc). Break it down into what you want and construct it a bit at a time. So in this case, start with "I want to add one each time the UP key is pressed." Each keypress is returned in l_key, so you are interested in when l_key matches the value of the Up key: "l_key == up" Which returns 1 (True) if the value of the key pressed (l_key) is equal to the value of the Up key (up) or 0 (False) if they don't match. Next you want to make sure that it doesn't go out of range, so you add "I want to not add anything, if the value is already at the maximum." So you only want to add one if the current value is less than the maximum value. That gives you "l_value l_max_value" You only want to add the 1 when both of these things are true, so combine the two: "l_key == up && l_value l_max_value" Which leads you to: "l_value = l_value + (l_key == up && l_value l_max_value)" Similar steps add the same functionality for the optional larger steps on the Right key. You may find it simpler to understand in a different form: "IF l_key == up { IF l_value l_max_value { l_value = l_value + 1 } } " The difference is that in this latter version each part only executes if the bit above is true, while in the former, the whole thing is evaluated and a result produced. Either version does the job. Snip OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. If it didn't work, and even with your explanation, the only chance I'd be able to spot the error is if the IDE highlighted the line *and* I could see the error visually (rather than logic or maths) by say the lack of symmetry. Does the breakdown of the process above help? If I take a complex machine to pieces the parts themselves often 'talk to me' in that I can see which was round a washer sat by the markings of the parts that were sat either side of it. It's a bgger when parts are marked on both sides though! Snip Trial and error is fine. That's how I started doing my Arduino programming. With practice, I can now write whole sections of program (say in my lunchbreak at work) in a text editor and just iron out a few bugs later when I can actually test it. Ok, I can do similar BUT only when it's a straight 'electronic routine that requires no, or very little maths. Eg, read the value from a pot, massage that value a bit (multiply by a constant typically) then output that value on a display. That's about my lot. If you think of it as comparisons and combining boolean results, it doesn't really bear much resemblence to maths as such. Snip Do you also remember DEBUG g=c800:5 Erm, accessing the ROM on a drive controller to start a LL format? (truly from memory)? That's the one. It is ingrained on my memory! Snip I'd struggle with the number (and people's names and faces). Ok. I'm 'not bad' with 'easy' faces and have to make an effort with names (some coming easier than others). I tend to apply a 'am I likely to need to remember their name for the future' test and then make an effort to remember it if I think I might. When I was an IT trainer and seeing ~8-10 different people for 5 days it was lucky if I could name them all by the end of the week and would have forgotten most by the week after. But that was why I gave them all name cards. ;-) I am so bad that out of the office context, I'l not recognise most people unless I've beenm seeing them regularly for a couple of months. As a contractor who moves around a fair bit, this is BAD! Even in the office, I have to note down everyone's name and where they sit for the first few weeks, as location is my best bet at identifying them if someone tells me to ask them a question! snip The idea was a single line with two sidings at each end and 3 locos available. The 'system' would check for vacancy / occupancy of the sidings and the 3 sections of the main run (current pulse in the power feed line). Once all 3 locos were in their sidings (pulsed IR opto-reflective sensors under the end of the siding for position), a random siding was selected from the double occupied end, the points set at both ends to give a clear route to the empty siding at the other and the loco driven with full inertia during both acceleration and deceleration to the opto sensor at the destination (the deceleration would start as the loco entered the end section of the main line (current detection) and then the loco would finally crawl to the final opto sensor). [1] A nice little system. I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( That's where a hardware safety system comes in An isolated section of track at the end of each siding, fed via a diode. Trains can't travel any further, but as the supply is reversed to drive the loco out again, the diode conducts and powers it. snip That said, I'm not sure I would have ever been able to do the coding required to pull it all together (inc the interactive bit, like 'How many locos do you want to run'?'). ;-( LCD shield; LCD library lets you display a prompt; pressing one of the buttons selects how many locos. You make all sound so easy Steve. ;-) So my interest was electronics and then bled over into computing, not the other way round. Was that analogue or digital? Boolean logic in software is no different that tying logic gates together. Now my interest is mostly just using a computer as an appliance, but I still don't mind doing some hardware stuff (again, only practical stuff, no LED lit cases and fans etc) and trying say Linux, just to see how far it has come on (I'm not that interested in OSX because I can't (officially / easily) run it on std IBM PC Clone hardware and I only have 5 Macs here). ;-) We are definitely a PC houshold here. A Dell 2950 server, 3 towers/mini-towers, two spare but dated mini-towers, two laptops and two spare but dated laptops. There are a few RPis dotted around. I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. I am building up, so only 4 locos to convert so far + a second-hand, faulty DMU that was an easy repair and already had a DCC chip in it. He didn't want to have to 'program' anything to make it run. I like the ease of operating locos right up to each other, such as a shunter removing carriages from a train at a station, without isolating sections all over or forming a double-header. I have wired with DCC in mind, so a continuous ring under the board supplying everything. As a child I had OO, analogue, but upgraded to the Hornby Zero-1 (pre-DCC digital control). I've not had a model railway since I sold it to buy my QL, but I have been buying odds-and-ends of n-gauge for some years. I've now got an l-shaped layout 12' x 3', plus 4' x 3' set up in the shed. Plans are to extend with another 12' x 3' section along the other wall one day. So this automated bit was just going to be an addition to his existing old-skool manual running etc. Cheers, T i m [1] I left school when I was 15 (August birthday) and went and did a 'Trans Ed' course at a local Technical College. O level English, Physics, Maths and Technical Drawing in the mornings, with practical stuff all afternoon (Electrical Engineering, Workshop Practice, Catering, Automobile Engineering and Welding / fabrication). Many people I knew and know who weren't overly academic would have loved / love to go on such a world-experience useful course. My experience of practical stuff was all with family - all aspects of DIY short of full extension builds; maintaining cheap family runarounds; building a 5" gauge steam loco chassis (never completed. Run on air, but we never built a boiler). What at the College I gained access to the 'Computer Room' and would often be online from the end of the last class till the caretaker chucked me out at 9pm. If the Decwriter ever went wrong on another 'Computer' course, *I* would be found in the college and requested (sometimes pulling me out of class) to go and fix it. ;-) Oh yes, computers can drag you into "working" 'til silly hours! SteveW |
#113
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 27/10/2017 22:47, dennis@home wrote:
On 27/10/2017 22:05, Steve Walker wrote: I am using a 0.9 - currently on 1/8th steps for smooth movement at low speed. The trouble is that while it makes the movement smoother it doesn't mean the motor will stop in the same place. Steppers really only do whole (double coil) or half (single coil) steps. Anything else is pretty well undefined. You can still stop on whole or half-steps, but use the microstepping while moving. SteveW |
#114
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Sat, 28 Oct 2017 00:03:10 +0100, Steve Walker
wrote: snip Lots of comments - even to the extend of commenting every line in places. Yes, that's what I was doing at the end, or at least for each sub module or unique subroutine / technique. Snip It does look quite complicated. But if you can get your head around binary and basic boolean logic it becomes quite simple. Ah ... and that is the big *IF* Steve. ;-( It isn't intuitive, Ain't that the truth.! ;-) but it is simple - after all, everything only has two states, 1 (True) or 0 (False). Well, true, sorta. If I told you the ip address of my router was: 1100000010101000000000001100100 whilst it is only a bunch of 1's and 0's, it's not actually easy for us to read / use. There are very few things to learn. There are loads of things to learn! Logical operators that work on True or False values: && (AND) 0 && 0 = 0 0 && 1 = 0 1 && 0 = 0 1 && 1 = 1 ¦¦ (OR) 0 ¦¦ 0 = 0 0 ¦¦ 1 = 1 1 ¦¦ 0 = 1 1 ¦¦ 1 = 1 ! (NOT) !0 = 1 !1 = 0 Ok, so that's some of the logic. Just the same as individual logic gates in digital electronics. Anything else can be made by combining them. Understood. and bitwise operators that work on complete bytes, words, etc. (I have used nybbles for simplicity): & (AND) 1010 & 0110 = 0010 ¦ (OR) 1010 ¦ 0110 = 1110 ~ (Complement) ~1010 = 0101 +-^ (XOR) 1010 ^ 0110 = 1100 So I'm guessing that is easy for you to take onboard, for me (without considerable consideration) it's still just gobbledygook, in the same way chess is from draughts. snip Like I mentioned previously ... not only do I have to deal with constructing the code, by creating and entering it by hand using a keyboard (rather than clicking on something), I *also* have to deal with the maths. I've not looked at it, but maybe Flowcode http://www.matrixtsl.com/flowcode/ might help you? I'll check that out (thanks) but I've tied some of the graphical programming tools and they are more confusing and (believe it or not), just as un intuitive to me as coding by hand. ;-( Funnily enough, for all of us I think there is an optimum level of ease and / or involvement fir the best direction / productivity. EG, I don't get on very well with the Apple OS's / GUI and they are meant to be easy (and they obviously are to many), but I often find them maddeningly frustrating. It's like they are only easy to someone who doesn't know what they are doing, and if you do, that UI actually gets in the way. I used to see this a lot with the Netware course manuals. All the exercises had a novice and normal mode to them. The novice mode was so easy, took you though using such simple steps I often got confused when trying to guide a delegate through it. Like ... to paint a wall: Novice mode: Go to the shops and choose your paint. Take the paint home. Get a flat-bladed screwdriver. Work you way round the lid with a levering action to pry off the lid. Find a long, thin, stiff object and use it to carefully stir the paint. Once fully stirred, wipe clean the stirrer. Dip the ... (I'm getting bored typing it all). Normal Mode. Stir the paint and apply to the wall at a rate of 1l per 10 sqm. snip Again, I could consider that section for ever and never be able to reproduce it myself. Not only because of my memory, not only because of my maths, but because of all of the programming tools that don't relate to anything I have ever been party to ITRW (like && etc). Break it down into what you want and construct it a bit at a time. Yeahbut can you not see Steve that is like saying if you want to run 100m all you have to do is practice running 1m first. I know I'll never make a good 100m runner, I wasn't any good at that when I was 15, but I could walk, row, cycle all day because that is what suited my build. So in this case, start with "I want to add one each time the UP key is pressed." Each keypress is returned in l_key, so you are interested in when l_key matches the value of the Up key: "l_key == up" Which returns 1 (True) if the value of the key pressed (l_key) is equal to the value of the Up key (up) or 0 (False) if they don't match. Next you want to make sure that it doesn't go out of range, so you add "I want to not add anything, if the value is already at the maximum." So you only want to add one if the current value is less than the maximum value. That gives you "l_value l_max_value" You only want to add the 1 when both of these things are true, so combine the two: "l_key == up && l_value l_max_value" Which leads you to: "l_value = l_value + (l_key == up && l_value l_max_value)" That lead *you* to that Steve. It just leads me to getting another beet or having a lay down. Similar steps add the same functionality for the optional larger steps on the Right key. You may find it simpler to understand in a different form: "IF l_key == up { IF l_value l_max_value { l_value = l_value + 1 } } " The difference is that in this latter version each part only executes if the bit above is true, while in the former, the whole thing is evaluated and a result produced. Steve, I know you mean well (and I am grateful etc) but all this really just leaves me cold, especially when looking at it abstractly like this (rather than after a day playing with it) etc. Either version does the job. I would really have to take your word for that. Snip OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. If it didn't work, and even with your explanation, the only chance I'd be able to spot the error is if the IDE highlighted the line *and* I could see the error visually (rather than logic or maths) by say the lack of symmetry. Does the breakdown of the process above help? Like I say, it probably would, *if* I had been trying / playing with it for a day or the weekend, and not just come in after helping our daughter fell a 40' conifer. It makes no more to me than someone giving me directions in a foreign language and that after you realise from the very first step that it means little, you just wait politely for them to finish, before trying again to see if the GPS can take you there. It's not a lack of effort, it's being totally out of your skillset and mind wiring. If I take a complex machine to pieces the parts themselves often 'talk to me' in that I can see which was round a washer sat by the markings of the parts that were sat either side of it. It's a bgger when parts are marked on both sides though! Well, yes, unless those marking were different in some minute way? I might spot such when others (who might be good at say coding) might not? snip Ok, I can do similar BUT only when it's a straight 'electronic routine that requires no, or very little maths. Eg, read the value from a pot, massage that value a bit (multiply by a constant typically) then output that value on a display. That's about my lot. If you think of it as comparisons and combining boolean results, it doesn't really bear much resemblence to maths as such. I'm not even sure what *that* means. ;-( ] Snip Do you also remember DEBUG g=c800:5 Erm, accessing the ROM on a drive controller to start a LL format? (truly from memory)? That's the one. It is ingrained on my memory! Quite ... something I have done over many years when my memory was still absorbing such things. I have had the same mobile number for around 20 years now and don't have even a clue what it is. But then I don't know (so can't remember) any birthdays or anniversaries either. See, they aren't important to me and so there are few consequences if I forget them. I don't know then the tax or insurance or MOT of any of our vehicles run out and rely on them reminding us or the Mrs having it in her diary. Snip I'd struggle with the number (and people's names and faces). Ok. I'm 'not bad' with 'easy' faces and have to make an effort with names (some coming easier than others). I tend to apply a 'am I likely to need to remember their name for the future' test and then make an effort to remember it if I think I might. When I was an IT trainer and seeing ~8-10 different people for 5 days it was lucky if I could name them all by the end of the week and would have forgotten most by the week after. But that was why I gave them all name cards. ;-) I am so bad that out of the office context, I'l not recognise most people unless I've beenm seeing them regularly for a couple of months. So if you can relate that to me and code you might get an idea what it's like for me? As a contractor who moves around a fair bit, this is BAD! Even in the office, I have to note down everyone's name and where they sit for the first few weeks, as location is my best bet at identifying them if someone tells me to ask them a question! Yup, we all have our 'blind spots' mate. ;-( snip I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( That's where a hardware safety system comes in An isolated section of track at the end of each siding, fed via a diode. Trains can't travel any further, but as the supply is reversed to drive the loco out again, the diode conducts and powers it. Yeah, we put that on after that event. ;-) snip So my interest was electronics and then bled over into computing, not the other way round. Was that analogue or digital? Boolean logic in software is no different that tying logic gates together. Practical computing really Steve ... My mate was the designer, I just came up with the ideas and did all the assembly / soldering etc. Now my interest is mostly just using a computer as an appliance, but I still don't mind doing some hardware stuff (again, only practical stuff, no LED lit cases and fans etc) and trying say Linux, just to see how far it has come on (I'm not that interested in OSX because I can't (officially / easily) run it on std IBM PC Clone hardware and I only have 5 Macs here). ;-) We are definitely a PC houshold here. A Dell 2950 server, 3 towers/mini-towers, two spare but dated mini-towers, two laptops and two spare but dated laptops. That's a proper house in my view. ;-) There are a few RPis dotted around. Same here. ;-) I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. I am building up, so only 4 locos to convert so far + a second-hand, faulty DMU that was an easy repair and already had a DCC chip in it. Ok. He didn't want to have to 'program' anything to make it run. I like the ease of operating locos right up to each other, such as a shunter removing carriages from a train at a station, without isolating sections all over or forming a double-header. Yeah, I'm sure it has it's advantages, but I think there are some for whom it's the way they know or nothing. Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. I on the other hand, I had no interest in taking pictures of people or the scenery but wanted reference shots or something I was working on, so for me digital photography was something that suited me perfectly. I even got out local camera shop to supply me with their first Digital camera sale. Take a shot, connect it to the PC, see / use / email your picture / reference-shot. I have wired with DCC in mind, so a continuous ring under the board supplying everything. Makes sense. As a child I had OO, analogue, but upgraded to the Hornby Zero-1 (pre-DCC digital control). I've not had a model railway since I sold it to buy my QL, but I have been buying odds-and-ends of n-gauge for some years. I've now got an l-shaped layout 12' x 3', plus 4' x 3' set up in the shed. Plans are to extend with another 12' x 3' section along the other wall one day. Nice. I had a small 'O' gauge layout as a kid but was more 'into' Meccano, Lego and ScaleXtric ... or making stuff myself from scratch. snip Many people I knew and know who weren't overly academic would have loved / love to go on such a world-experience useful course. My experience of practical stuff was all with family - all aspects of DIY short of full extension builds; maintaining cheap family runarounds; Been there, still doing that. ;-) building a 5" gauge steam loco chassis (never completed. Run on air, but we never built a boiler). I understand that can be quite a step, getting such things pressure tested etc? What at the College I gained access to the 'Computer Room' and would often be online from the end of the last class till the caretaker chucked me out at 9pm. If the Decwriter ever went wrong on another 'Computer' course, *I* would be found in the college and requested (sometimes pulling me out of class) to go and fix it. ;-) Oh yes, computers can drag you into "working" 'til silly hours! And that is something I've always been happy to do. When I was a Field Support Guy / looked after the internal IT and ran the telephone 'Help Desk, the only time extra work could get done was when everyone else when home. So, I spent many an evening or weekend at work (voluntarily) installing new kit or trying new things, ready for the Monday because ... it was the only practical way of doing it and I quite enjoyed being able to focus on something without the constant interruptions (customers or internal staff etc). ;-) I would always step up when 'all hands were to the pumps' or when it suited me to do stuff in the evenings etc but I rarely took on any overtime because I valued my own / family time more than the money. Cheers, T i m |
#115
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 28/10/2017 21:10, T i m wrote:
On Sat, 28 Oct 2017 00:03:10 +0100, Steve Walker wrote: snip Lots of comments - even to the extend of commenting every line in places. Yes, that's what I was doing at the end, or at least for each sub module or unique subroutine / technique. Snip It does look quite complicated. But if you can get your head around binary and basic boolean logic it becomes quite simple. Ah ... and that is the big *IF* Steve. ;-( It isn't intuitive, Ain't that the truth.! ;-) but it is simple - after all, everything only has two states, 1 (True) or 0 (False). Well, true, sorta. If I told you the ip address of my router was: 1100000010101000000000001100100 whilst it is only a bunch of 1's and 0's, it's not actually easy for us to read / use. There are very few things to learn. There are loads of things to learn! Logical operators that work on True or False values: && (AND) 0 && 0 = 0 0 && 1 = 0 1 && 0 = 0 1 && 1 = 1 ¦¦ (OR) 0 ¦¦ 0 = 0 0 ¦¦ 1 = 1 1 ¦¦ 0 = 1 1 ¦¦ 1 = 1 ! (NOT) !0 = 1 !1 = 0 Ok, so that's some of the logic. Just the same as individual logic gates in digital electronics. Anything else can be made by combining them. Understood. and bitwise operators that work on complete bytes, words, etc. (I have used nybbles for simplicity): & (AND) 1010 & 0110 = 0010 ¦ (OR) 1010 ¦ 0110 = 1110 ~ (Complement) ~1010 = 0101 +-^ (XOR) 1010 ^ 0110 = 1100 So I'm guessing that is easy for you to take onboard, for me (without considerable consideration) it's still just gobbledygook, in the same way chess is from draughts. It is no different than the logical operators really, just that it does it for each bit in the nybble, byte, word, long word or whatever. snip Like I mentioned previously ... not only do I have to deal with constructing the code, by creating and entering it by hand using a keyboard (rather than clicking on something), I *also* have to deal with the maths. I've not looked at it, but maybe Flowcode http://www.matrixtsl.com/flowcode/ might help you? I'll check that out (thanks) but I've tied some of the graphical programming tools and they are more confusing and (believe it or not), just as un intuitive to me as coding by hand. ;-( Quite possibly. I have never used a graphical programming system, so I have no idea what they are like. Funnily enough, for all of us I think there is an optimum level of ease and / or involvement fir the best direction / productivity. EG, I don't get on very well with the Apple OS's / GUI and they are meant to be easy (and they obviously are to many), but I often find them maddeningly frustrating. It's like they are only easy to someone who doesn't know what they are doing, and if you do, that UI actually gets in the way. Yes, such partially changing the names of a whole group of files or serching a whole directory tree for certain filenames without also searching within each file and taking forever (which idiot at Microsoft thought that removing the option to search only filenames was a good idea?) I used to see this a lot with the Netware course manuals. All the exercises had a novice and normal mode to them. The novice mode was so easy, took you though using such simple steps I often got confused when trying to guide a delegate through it. Like ... to paint a wall: Novice mode: Go to the shops and choose your paint. Take the paint home. Get a flat-bladed screwdriver. Work you way round the lid with a levering action to pry off the lid. Find a long, thin, stiff object and use it to carefully stir the paint. Once fully stirred, wipe clean the stirrer. Dip the ... (I'm getting bored typing it all). Normal Mode. Stir the paint and apply to the wall at a rate of 1l per 10 sqm. snip Again, I could consider that section for ever and never be able to reproduce it myself. Not only because of my memory, not only because of my maths, but because of all of the programming tools that don't relate to anything I have ever been party to ITRW (like && etc). Break it down into what you want and construct it a bit at a time. Yeahbut can you not see Steve that is like saying if you want to run 100m all you have to do is practice running 1m first. I know I'll never make a good 100m runner, I wasn't any good at that when I was 15, but I could walk, row, cycle all day because that is what suited my build. I'd argue that physical activity is related to build and my partial face-blindness is related to the structure of my brain. Logic, like maths or English is something to be learned. I will accept that some brains are more suited to learning it than others, but for those that find it difficult, they could do it - if it mattered enough to them to work at it, but of course there is often too much else in life and it is not something important enough to matter. So in this case, start with "I want to add one each time the UP key is pressed." Each keypress is returned in l_key, so you are interested in when l_key matches the value of the Up key: "l_key == up" Which returns 1 (True) if the value of the key pressed (l_key) is equal to the value of the Up key (up) or 0 (False) if they don't match. Next you want to make sure that it doesn't go out of range, so you add "I want to not add anything, if the value is already at the maximum." So you only want to add one if the current value is less than the maximum value. That gives you "l_value l_max_value" You only want to add the 1 when both of these things are true, so combine the two: "l_key == up && l_value l_max_value" Which leads you to: "l_value = l_value + (l_key == up && l_value l_max_value)" That lead *you* to that Steve. It just leads me to getting another beet or having a lay down. Thanks for that, you just reminded me that I'd left a Grolsch open in the kitchen! Similar steps add the same functionality for the optional larger steps on the Right key. You may find it simpler to understand in a different form: "IF l_key == up { IF l_value l_max_value { l_value = l_value + 1 } } " The difference is that in this latter version each part only executes if the bit above is true, while in the former, the whole thing is evaluated and a result produced. Steve, I know you mean well (and I am grateful etc) but all this really just leaves me cold, especially when looking at it abstractly like this (rather than after a day playing with it) etc. Fair enough. I'll leave it at that. Either version does the job. I would really have to take your word for that. Snip OK, now say I was actually coding this from your examples I be able to copy and paste it into the sketch and if it worked, great. However, all I would be able to learn from that is how to copy and paste. If it didn't work, and even with your explanation, the only chance I'd be able to spot the error is if the IDE highlighted the line *and* I could see the error visually (rather than logic or maths) by say the lack of symmetry. Does the breakdown of the process above help? Like I say, it probably would, *if* I had been trying / playing with it for a day or the weekend, and not just come in after helping our daughter fell a 40' conifer. It makes no more to me than someone giving me directions in a foreign language and that after you realise from the very first step that it means little, you just wait politely for them to finish, before trying again to see if the GPS can take you there. It's not a lack of effort, it's being totally out of your skillset and mind wiring. If I take a complex machine to pieces the parts themselves often 'talk to me' in that I can see which was round a washer sat by the markings of the parts that were sat either side of it. It's a bgger when parts are marked on both sides though! Well, yes, unless those marking were different in some minute way? I might spot such when others (who might be good at say coding) might not? snip Ok, I can do similar BUT only when it's a straight 'electronic routine that requires no, or very little maths. Eg, read the value from a pot, massage that value a bit (multiply by a constant typically) then output that value on a display. That's about my lot. If you think of it as comparisons and combining boolean results, it doesn't really bear much resemblence to maths as such. I'm not even sure what *that* means. ;-( Comparisons are just like in normal maths (, , =, etc.) Boolean logic is just ANDs ORs, etc. named after George Boole, who came up the notation for it in the 19th century. ] Snip Do you also remember DEBUG g=c800:5 Erm, accessing the ROM on a drive controller to start a LL format? (truly from memory)? That's the one. It is ingrained on my memory! Quite ... something I have done over many years when my memory was still absorbing such things. I have had the same mobile number for around 20 years now and don't have even a clue what it is. But then I don't know (so can't remember) any birthdays or anniversaries either. See, they aren't important to me and so there are few consequences if I forget them. I don't know then the tax or insurance or MOT of any of our vehicles run out and rely on them reminding us or the Mrs having it in her diary. I am also bad at dates - I can remember my wife's, children's and parents' birthdays, those of a couple of aunts and uncles and our wedding anniversary (not that that's difficult, as our eldest child was born on our first anniversary). I don't remember dates such as when my in-laws died, when my wife suffered miscarriages, etc. - she reminds me. My wife is frightening with dates (and names and faces). She can meet someone she's not met for 20 years, recognise them and name their children and their birthdays! In one meeting, she stunned her colleagues by recognizing the name of a newly referred patient, remembering she'd dealt with her 7 years earlier in a different team and quoted the dates she'd dealt with her, her address and date of birth to confirm it was the same person! Snip I'd struggle with the number (and people's names and faces). Ok. I'm 'not bad' with 'easy' faces and have to make an effort with names (some coming easier than others). I tend to apply a 'am I likely to need to remember their name for the future' test and then make an effort to remember it if I think I might. When I was an IT trainer and seeing ~8-10 different people for 5 days it was lucky if I could name them all by the end of the week and would have forgotten most by the week after. But that was why I gave them all name cards. ;-) I am so bad that out of the office context, I'l not recognise most people unless I've beenm seeing them regularly for a couple of months. So if you can relate that to me and code you might get an idea what it's like for me? As a contractor who moves around a fair bit, this is BAD! Even in the office, I have to note down everyone's name and where they sit for the first few weeks, as location is my best bet at identifying them if someone tells me to ask them a question! Yup, we all have our 'blind spots' mate. ;-( snip I think it could / would have been, had I had the time to refine the electronics / hardware further and got my mate in on the code etc. If you get the hardware, logic or timing wrong you watch an expensive loco going though the buffers and off under the eaves. ;-( That's where a hardware safety system comes in An isolated section of track at the end of each siding, fed via a diode. Trains can't travel any further, but as the supply is reversed to drive the loco out again, the diode conducts and powers it. Yeah, we put that on after that event. ;-) snip So my interest was electronics and then bled over into computing, not the other way round. Was that analogue or digital? Boolean logic in software is no different that tying logic gates together. Practical computing really Steve ... My mate was the designer, I just came up with the ideas and did all the assembly / soldering etc. Hmmm. I can do PCB design, etch the boards and assemble everything for my own designs, but I just can't find the time, energy or will to do so. Now my interest is mostly just using a computer as an appliance, but I still don't mind doing some hardware stuff (again, only practical stuff, no LED lit cases and fans etc) and trying say Linux, just to see how far it has come on (I'm not that interested in OSX because I can't (officially / easily) run it on std IBM PC Clone hardware and I only have 5 Macs here). ;-) We are definitely a PC houshold here. A Dell 2950 server, 3 towers/mini-towers, two spare but dated mini-towers, two laptops and two spare but dated laptops. That's a proper house in my view. ;-) I'm not sure my wife would agree! There are a few RPis dotted around. Same here. ;-) I think my next "project" will be using DCC++ (no need for programming, just download and use, but maybe tweak later) which turns an Arduino and motor shield into a DCC controller. Once I have that running, I can look at adding DCC control to the turntable program (again there is a library for decoding DCC packets). BIL was trying to avoid going DCC because: He has a large inventory of analogue rolling stock he didn't want to change. I am building up, so only 4 locos to convert so far + a second-hand, faulty DMU that was an easy repair and already had a DCC chip in it. Ok. He didn't want to have to 'program' anything to make it run. I like the ease of operating locos right up to each other, such as a shunter removing carriages from a train at a station, without isolating sections all over or forming a double-header. Yeah, I'm sure it has it's advantages, but I think there are some for whom it's the way they know or nothing. The Zero-1 was good for that. A very simple operation, with a numeric pad and a few dedicated buttons. Then control by a sliding speed control and a click, one way or the other direction switch. loco 1 enter - to take control of loco 1 It could then be driven up to another loco until they coupled. loco 1 loco 2 enter - to take control of both locos as a double-header. The only other bits were assigning a loco to a slave controller. contoller 2 loco 1 enter and assigning an inertia so to simulate the acceleration and deceleration of a real train. loco 1 intertia 3 enter That's from memory, so I may have got that wrong, but it really was as simple as that. DCC controllers do have far more options and much more to learn. No need to use most of it if not wanted though I suppose. Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. A pity. I used to use film cameras. I switched to a digital SLR. I still use it like a film camera, but with the advantage of taking numerous near identical shots at zero extra cost and throwing away what I don't want. I do sometimes edit photos on the PC, but usually they just get stored in "albums" and printed if required. I on the other hand, I had no interest in taking pictures of people or the scenery but wanted reference shots or something I was working on, so for me digital photography was something that suited me perfectly. I even got out local camera shop to supply me with their first Digital camera sale. Take a shot, connect it to the PC, see / use / email your picture / reference-shot. My phone tends to get used for reference shots or even for just reading a label that is round the back. I have wired with DCC in mind, so a continuous ring under the board supplying everything. Makes sense. As a child I had OO, analogue, but upgraded to the Hornby Zero-1 (pre-DCC digital control). I've not had a model railway since I sold it to buy my QL, but I have been buying odds-and-ends of n-gauge for some years. I've now got an l-shaped layout 12' x 3', plus 4' x 3' set up in the shed. Plans are to extend with another 12' x 3' section along the other wall one day. Nice. I had a small 'O' gauge layout as a kid but was more 'into' Meccano, Lego and ScaleXtric ... or making stuff myself from scratch. Oh yes. I had set 10 meccano (the tower crane, etc.) and a fair bit of lego. I never had a Scalextric set, but had several friends who did. snip Many people I knew and know who weren't overly academic would have loved / love to go on such a world-experience useful course. My experience of practical stuff was all with family - all aspects of DIY short of full extension builds; maintaining cheap family runarounds; Been there, still doing that. ;-) Yes. I think digging out and repairing a septic tank was probably the low point! building a 5" gauge steam loco chassis (never completed. Run on air, but we never built a boiler). I understand that can be quite a step, getting such things pressure tested etc? It's building them well enough that is the problem. Pressure testing them is easy. Just fill with water, making sure there is no trapped air and pump up to the test pressure with the loco's own water pump or an external hand pump, while ensuring that the safety valves are prevented from relieving the pressure. Partially drain and then light up and steam test - including that the safety valves work at the correct pressure. I've done that long ago with someone else's loco at the local Model Engineering Society. When the European Pressure Directives came in, our government obtained a concession for model steam boilers, so such testing is accepted, without having to involve an expensive, professional, testing body. What at the College I gained access to the 'Computer Room' and would often be online from the end of the last class till the caretaker chucked me out at 9pm. If the Decwriter ever went wrong on another 'Computer' course, *I* would be found in the college and requested (sometimes pulling me out of class) to go and fix it. ;-) Oh yes, computers can drag you into "working" 'til silly hours! And that is something I've always been happy to do. When I was a Field Support Guy / looked after the internal IT and ran the telephone 'Help Desk, the only time extra work could get done was when everyone else when home. So, I spent many an evening or weekend at work (voluntarily) installing new kit or trying new things, ready for the Monday because ... it was the only practical way of doing it and I quite enjoyed being able to focus on something without the constant interruptions (customers or internal staff etc). ;-) I would always step up when 'all hands were to the pumps' or when it suited me to do stuff in the evenings etc but I rarely took on any overtime because I valued my own / family time more than the money. Yes. Family is so important. It does keep getting in the way when you find two parents' evening at two schools and the kids dental checkups in the same week that you were planning to work overtime - as I had three weeks ago! SteveW |
#116
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Sat, 28 Oct 2017 22:30:35 +0100, Steve Walker
wrote: snip So I'm guessing that is easy for you to take onboard, for me (without considerable consideration) it's still just gobbledygook, in the same way chess is from draughts. It is no different than the logical operators really, just that it does it for each bit in the nybble, byte, word, long word or whatever. Sorry, I was talking about coding in general there Steve. snip I've not looked at it, but maybe Flowcode http://www.matrixtsl.com/flowcode/ might help you? I'll check that out (thanks) but I've tied some of the graphical programming tools and they are more confusing and (believe it or not), just as un intuitive to me as coding by hand. ;-( Quite possibly. I have never used a graphical programming system, so I have no idea what they are like. To me, the test is 'are they intuitive'? So, I know roughly what I want to do and so in theory a visual / GUI programming system *should* be very easy. Except, again their are rules and rules that need to be learned rather than explored. eg, You pick up an icon that represent a step and then try to follow that with what you think you want / should_be_able to do next, but it won't let you ... and it doesn't say why. Now, if part of the process is getting you to do trial and error (rather than suggesting what you are doing wrong and / or offering alternatives) than so be it but then again, that's not what I'm looking for. I (just) want the fire, I don't want to make a hobby out of learning how to make a bow and a diy firelighter (when there are already matches out there). Funnily enough, for all of us I think there is an optimum level of ease and / or involvement fir the best direction / productivity. EG, I don't get on very well with the Apple OS's / GUI and they are meant to be easy (and they obviously are to many), but I often find them maddeningly frustrating. It's like they are only easy to someone who doesn't know what they are doing, and if you do, that UI actually gets in the way. Yes, such partially changing the names of a whole group of files Yup. or serching a whole directory tree for certain filenames without also searching within each file and taking forever (which idiot at Microsoft thought that removing the option to search only filenames was a good idea?) ;-) Yup, there are things that *if you know what you are doing* are / can be faster from the CLI than the UI. However, they aren't intuitive and so are *only* any good once you know (have learned) of them and how to use them. snip Yeahbut can you not see Steve that is like saying if you want to run 100m all you have to do is practice running 1m first. I know I'll never make a good 100m runner, I wasn't any good at that when I was 15, but I could walk, row, cycle all day because that is what suited my build. I'd argue that physical activity is related to build Quite. I could run 100 years reasonably quickly because I was tall and thin and could do it on one breath. I couldn't run 200 yards + because my respiratory system (or whatever) wasn't up to it. I could jump higher than most because I was tall and It wasn't an aerobic exercise. So my physical limitations were that of limiting my sustained peak output. So, had that part of me been built differently I could have done the 200m faster, just if my brain was wired differently I could code better. and my partial face-blindness is related to the structure of my brain. Ok. Logic, like maths or English is something to be learned. Of course, but the *ease* with which people are able to learn things is based on exactly the same set of wiring. I will accept that some brains are more suited to learning it than others, but for those that find it difficult, they could do it - if it mattered enough to them to work at it, but of course there is often too much else in life and it is not something important enough to matter. To a degree, yes. However, *some people* are right handed and others left handed and whist either could probably practice and probably be ambidextrous, that natural bias will probably still be there. snip That lead *you* to that Steve. It just leads me to getting another beet or having a lay down. Thanks for that, you just reminded me that I'd left a Grolsch open in the kitchen! You are welcome ... 'cheers'. ;-) snip Steve, I know you mean well (and I am grateful etc) but all this really just leaves me cold, especially when looking at it abstractly like this (rather than after a day playing with it) etc. Fair enough. I'll leave it at that. So, you are obviously skilled in coding (all be it from effort seeded by an interest and particular brain wiring etc) and therefore it looks to come easy to you (now). I am not so skilled and often need some specific help, just in the way I am asked by many to help them with things they need doing but openly admit they don't have any interest / experience or skills in. And because I understand / accept that we are all good / interested in different things, I often just do whatever is required, even if they themselves won't necessarily be able to return the favour because in general, someone else often will. So, what would help me, is if I have such a coding issue, someone who could actually understand the requirement and it good at and enjoys the coding part, does it for me, leaving me to the bit of the project I actually do understand and enjoy and that the electronics and implementation. So it's not like I'm asking someone to do it for me, I'm just asking someone to do the bit of it I find near impossible and completely frustrating for me, based upon my offering the sub-module code testing and working (so it's not like I'm not doing any of that side). I'm not expecting such, I'm just saying that is what would actually constitute real help for me. snip If you think of it as comparisons and combining boolean results, it doesn't really bear much resemblence to maths as such. I'm not even sure what *that* means. ;-( Comparisons are just like in normal maths (, , =, etc.) Quite ... and as soon as they appear in front of me the levels of stress, tension and frustration start to build up. ;-( Boolean logic is just ANDs ORs, etc. named after George Boole, who came up the notation for it in the 19th century. Interesting, ta. ;-) snip I don't know then the tax or insurance or MOT of any of our vehicles run out and rely on them reminding us or the Mrs having it in her diary. I am also bad at dates - I can remember my wife's, children's and parents' birthdays, those of a couple of aunts and uncles and our wedding anniversary Well, that's probably ~10 more than I and they are our immediate ones! Seriously, I've been married to this wife 30+ years (?) and the best I can do is say that I think her birthday is in March sometime. Part of this is my personal lack of interest in such things ... never sending (or caring for) birthday or anniversary cards or even 'celebrating' the events themselves. (that's not that that's difficult, as our eldest child was born on our first anniversary). That wouldn't help me much. ;-) I don't remember dates such as when my in-laws died, when my wife suffered miscarriages, etc. - she reminds me. I'm not sure if the Mrs actually 'remembers' the actual dates of those things either, but she notes them in her diary. My wife is frightening with dates (and names and faces). She can meet someone she's not met for 20 years, recognise them and name their children and their birthdays! Weird! (to us obviously). My first girlfriend (when we were 15-17) took and passed (with high scores) 10 O levels when I struggled to get 3. When out in my Messerschmitt once we met another on the road and stopped for a quick chat. He offered us his phone number and I started scrabbling for a bit of paper and pen to write it down. Girlfriend said 'I've got it' but I saw no notes being made? I questioned that she had and that we should write it down ASAP. I forgot completely then when seeing her again two weeks later I suddenly remembered I hadn't written it down anywhere and asked her if she had. She said she hadn't but just rattled it off? So, did she practice / train to have a memory like that or was she just gifted with such? In one meeting, she stunned her colleagues by recognizing the name of a newly referred patient, remembering she'd dealt with her 7 years earlier in a different team and quoted the dates she'd dealt with her, her address and date of birth to confirm it was the same person! Amazing. Now, in a similarly strange way, I can and often do remember all sorts of things, like where I suggested someone wrote down their online accounts and password ... or even what their password was. Or I can remember when in the garage I put the thing I've not seen or used for 15 years. My memory seems to work with things and places, not with information as such (so I'll recognise a face, but not a name). snip Was that analogue or digital? Boolean logic in software is no different that tying logic gates together. Practical computing really Steve ... My mate was the designer, I just came up with the ideas and did all the assembly / soldering etc. Hmmm. I can do PCB design, etch the boards and assemble everything for my own designs, but I just can't find the time, energy or will to do so. I'm similar (for a very basic level) and for the same reason as you, find the likes of the Arduino as you can often do a lot with very little in the way of discrete / wiring effort (and hence more likely for me to actually do it alongside all the other stuff I'm supposed to be doing). snip We are definitely a PC houshold here. A Dell 2950 server, 3 towers/mini-towers, two spare but dated mini-towers, two laptops and two spare but dated laptops. That's a proper house in my view. ;-) I'm not sure my wife would agree! Nor mine ... but she (mostly) puts up with it. ;-) snip Yeah, I'm sure it has it's advantages, but I think there are some for whom it's the way they know or nothing. The Zero-1 was good for that. A very simple operation, with a numeric pad and a few dedicated buttons. Then control by a sliding speed control and a click, one way or the other direction switch. loco 1 enter - to take control of loco 1 It could then be driven up to another loco until they coupled. loco 1 loco 2 enter - to take control of both locos as a double-header. The only other bits were assigning a loco to a slave controller. contoller 2 loco 1 enter and assigning an inertia so to simulate the acceleration and deceleration of a real train. loco 1 intertia 3 enter Yeah, that seems simple enough ... however, not the same UI as turning a rheostat knob and managing the inertia yourself (as you might if stood on the footplate)? That's from memory, so I may have got that wrong, but it really was as simple as that. DCC controllers do have far more options and much more to learn. No need to use most of it if not wanted though I suppose. A family friend was keen to show me one of his 'fully loaded' DCC locos with all the sounds and lights etc. It was pretty impressive I must say. Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. A pity. It was in a way ... Similarly I know a guy who owned 4 'record shops' who gradually shrank it down to one as the market was going all digital / streaming. I suggested he might carry on his business 'online' (lower overheads, more niche etc) and he said he'd rather give it all up and go minicabbing. The point was, it wasn't just to do with making a living, it was also to do with the customer interface and being involved with it all with them in a very tangible way. I used to use film cameras. I switched to a digital SLR. I still use it like a film camera, but with the advantage of taking numerous near identical shots at zero extra cost and throwing away what I don't want. ;-) I do sometimes edit photos on the PC, but usually they just get stored in "albums" and printed if required. Ok, same here (apart from a bit of cropping and de-resing if I'm emailed it etc). I on the other hand, I had no interest in taking pictures of people or the scenery but wanted reference shots or something I was working on, so for me digital photography was something that suited me perfectly. I even got out local camera shop to supply me with their first Digital camera sale. Take a shot, connect it to the PC, see / use / email your picture / reference-shot. My phone tends to get used for reference shots or even for just reading a label that is round the back. Hehe, same here ... I'm not even sure where my actual camera is. ;-( snip Nice. I had a small 'O' gauge layout as a kid but was more 'into' Meccano, Lego and ScaleXtric ... or making stuff myself from scratch. Oh yes. I had set 10 meccano (the tower crane, etc.) and a fair bit of lego. Did you generally build the kits or go free-form Steve? I think I might have done a bit of both ... built the 'classic' thing first / once and then gone free-form from there. I never had a Scalextric set, but had several friends who did. I bought a couple of cheap sets with a neighbour a while back and in his empty through-lounge we were able to build some pretty good layouts (one massive 4 lane straight and wiggly bits for the way back). However, once playing with it again it soon reminded me why I went to RC cars, boats (and to a lesser degree), planes. Been there, still doing that. ;-) Yes. I think digging out and repairing a septic tank was probably the low point! I can imagine it would be. ;-( building a 5" gauge steam loco chassis (never completed. Run on air, but we never built a boiler). I understand that can be quite a step, getting such things pressure tested etc? It's building them well enough that is the problem. Ok. Pressure testing them is easy. Just fill with water, making sure there is no trapped air and pump up to the test pressure with the loco's own water pump or an external hand pump, while ensuring that the safety valves are prevented from relieving the pressure. Ok. But don't you need to get that authorised somehow? Partially drain and then light up and steam test - including that the safety valves work at the correct pressure. Ok. I've done that long ago with someone else's loco at the local Model Engineering Society. Ok. When the European Pressure Directives came in, our government obtained a concession for model steam boilers, so such testing is accepted, without having to involve an expensive, professional, testing body. Ah, that answers my question above. snip I would always step up when 'all hands were to the pumps' or when it suited me to do stuff in the evenings etc but I rarely took on any overtime because I valued my own / family time more than the money. Yes. Family is so important. It does keep getting in the way when you find two parents' evening at two schools and the kids dental checkups in the same week that you were planning to work overtime - as I had three weeks ago! For me it's now mostly running Mum about (luckily she's getting all over the place at 87, including going to Spain with our daughter this year ... sherry region, no Nightclubs g) and whilst she did also go all over the place with Dad, now she's probably doing more of what 'she' wants / likes. So we take it in turns within the family running her here and there. The other day we dropped her at Walton on the Naze (to be collected by Sister and BIL a few days later) and before that we picked her up from the HoverSpeed terminal from the IOW. ;-) When she is actually at home we combine doing any bits she needs / want's done at home with seeing her and having a meal (either her cooking for all of us, me cooking for all of us or having a Kebab delivered (that she's now quite partial to). ;-) We seem to do the lions share of her hospital visits as we only live round the corner ... but that's fair as Sister and family do more fun stuff with her. ;-) Right, I woke up for some reason and couldn't get back to sleep but I might try again now ... Cheers, T i m |
#117
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 28/10/2017 21:10, T i m wrote:
Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. did no one tell him that taking a picture is exactly the same with a digital camera as a film camera? The only real difference is if you enable the automation and that you can look at the result. Did he print his own pictures and that is what he missed? |
#118
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On Sun, 29 Oct 2017 11:30:38 +0000, "dennis@home"
wrote: On 28/10/2017 21:10, T i m wrote: Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. did no one tell him that taking a picture is exactly the same with a digital camera as a film camera? I think he knew that but that wasn't the point. The only real difference is if you enable the automation and that you can look at the result. And how you 'load' the camera, make the choices of the film, the resolution for the cost (especially at the beginning) and the way they were processed etc. Did he print his own pictures and that is what he missed? Nope, he used a lab. It's just the same as someone who likes analogue model railways over digital ones. Yes it can be very similar but it isn't the same (or you could run them both on either system). ;-) Cheers, T i m |
#119
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 29/10/2017 14:35, T i m wrote:
On Sun, 29 Oct 2017 11:30:38 +0000, "dennis@home" wrote: On 28/10/2017 21:10, T i m wrote: Like my Dad, he was a very keen Amateur Photographer and for him the 'art' was all in the composition and getting the focus / depth of field / lighting and many other properties right etc. So, when the world went digital he basically dropped out of the whole scene because he wasn't interested or ready for the whole camera / PC thing. did no one tell him that taking a picture is exactly the same with a digital camera as a film camera? I think he knew that but that wasn't the point. The only real difference is if you enable the automation and that you can look at the result. And how you 'load' the camera, make the choices of the film, the resolution for the cost (especially at the beginning) and the way they were processed etc. All of those things can be changed in a digital camera, either before you take the picture or after you take it. Did he print his own pictures and that is what he missed? Nope, he used a lab. It's just the same as someone who likes analogue model railways over digital ones. Yes it can be very similar but it isn't the same (or you could run them both on either system). ;-) Cheers, T i m |
#120
Posted to uk.d-i-y
|
|||
|
|||
diy data recovery
On 29/10/2017 04:38, T i m wrote:
On Sat, 28 Oct 2017 22:30:35 +0100, Steve Walker wrote: snip The Zero-1 was good for that. A very simple operation, with a numeric pad and a few dedicated buttons. Then control by a sliding speed control and a click, one way or the other direction switch. loco 1 enter - to take control of loco 1 It could then be driven up to another loco until they coupled. loco 1 loco 2 enter - to take control of both locos as a double-header. The only other bits were assigning a loco to a slave controller. contoller 2 loco 1 enter and assigning an inertia so to simulate the acceleration and deceleration of a real train. loco 1 intertia 3 enter Yeah, that seems simple enough ... however, not the same UI as turning a rheostat knob and managing the inertia yourself (as you might if stood on the footplate)? In some ways it is more realistic. The speed control was a sliding potentiometer rather than rotary rheostat, but unlike using a rheostat, when inertia was enabled, the power to the motor didn't vary immediately with position, so bringing a train into a station involved anticipating where it would stop, just like hundreds of tons of real train. The same inertia effect can be included in analogue controllers as well. Some even have a brake control, so there is a combination of throttle and interia for acceleration and brake and inertia for decelleration. That's from memory, so I may have got that wrong, but it really was as simple as that. DCC controllers do have far more options and much more to learn. No need to use most of it if not wanted though I suppose. A family friend was keen to show me one of his 'fully loaded' DCC locos with all the sounds and lights etc. It was pretty impressive I must say. Yes. Adding all the sounds and lights in n-gauge maybe going a bit too far! It could be worse, the smallest commercially available gauage now is T-gauge (1:450) - just right for using the chassis to model an 18" narrow gauge line for a n-scale layout (or close enough to modelling a 5" gauge park railway on an O-scale layout). snip Nice. I had a small 'O' gauge layout as a kid but was more 'into' Meccano, Lego and ScaleXtric ... or making stuff myself from scratch. Oh yes. I had set 10 meccano (the tower crane, etc.) and a fair bit of lego. Did you generally build the kits or go free-form Steve? I think I might have done a bit of both ... built the 'classic' thing first / once and then gone free-form from there. Both. I certainly remember building freelance helicopters (the motorised rotors were lethal) and cablecars running up to the curtain rail. I never had a Scalextric set, but had several friends who did. I bought a couple of cheap sets with a neighbour a while back and in his empty through-lounge we were able to build some pretty good layouts (one massive 4 lane straight and wiggly bits for the way back). However, once playing with it again it soon reminded me why I went to RC cars, boats (and to a lesser degree), planes. snip For me it's now mostly running Mum about (luckily she's getting all over the place at 87, including going to Spain with our daughter this year ... sherry region, no Nightclubs g) and whilst she did also go all over the place with Dad, now she's probably doing more of what 'she' wants / likes. So we take it in turns within the family running her here and there. The other day we dropped her at Walton on the Naze (to be collected by Sister and BIL a few days later) and before that we picked her up from the HoverSpeed terminal from the IOW. ;-) When she is actually at home we combine doing any bits she needs / want's done at home with seeing her and having a meal (either her cooking for all of us, me cooking for all of us or having a Kebab delivered (that she's now quite partial to). ;-) We seem to do the lions share of her hospital visits as we only live round the corner ... but that's fair as Sister and family do more fun stuff with her. ;-) I'm lucky in that respect. My mother is 76 and my father is 80 and both are still running themselves and each other wherever they need to go. In fact, my dad usually does the school run with our youngest son, although today and for the next 3 Mondays, plus a Wednesday, he's switched to taking the older two, as the bus drivers are on strike, the secondary school is 7 miles away and my wife is nervous of driving there during rush hour, but she can cope with the local run to the primary school instead. It all gets a bit mixed up anyway because she is working nights now. Both my F-I-L and M-I-L died years ago, so no help needed there. SteveW |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
D-I-Y CD data recovery via overspraying the lacquer layer? | UK diy | |||
Attempt at hdd data recovery | Electronics Repair | |||
Data Recovery | Electronics Repair | |||
HDD Repairing and Data Recovery | Electronics Repair | |||
need advice on data recovery service company | Electronics Repair |