By continuing to use this site, you agree to our use of cookies. Find out more

Member postings for James Alford

Here is a list of all the postings James Alford has made in our forums. Click on a thread name to jump to the thread.

Thread: Arduino Uno Programming Assistance Request
04/01/2018 07:48:28
Posted by Marcus Bowman on 04/01/2018 07:45:04:

James,

Ah, but that was work...

Welcome back to mental gymnastics...?

Marcus

Marcus,

Fair point about work as I could spend all day, everyday working it all out.

Definitely mental gymnastics: not a bad thing, though as it saves vegetating.

James.

04/01/2018 07:21:34

Thank you for the additional suggestions, which I shall look at.

What I am finding personally frustrating is that some years ago, I designed, wrote, implemented and maintained a bespoke software programme for a major telephone company. The system was used across their call centres to gather call data, help to route the call, to read data directly from the screen and feed it back into the programme for later use, gather marketing data and generate tailored marketing materials for each call. All of the data was dumped and collated in a single point on a server; I also created the distribution and update process for the it all. I used Visual Basics.

The trouble is that it was back in the late 1990s and I am blowed if I can remember much at all about how I did it and have done very little like it since.

James.

03/01/2018 07:34:11

Dave: just a quick update. I have integrated your "pulse" code into my programme, adjusting it to activate pin 12, rather than 13 as 13 is in use already. It does exactly what I want it to do. I now need to write the sequences to trigger the pulsing after the final quarter has been struck on the hour. This should be fairly straightforward........... famous last words: watch this space.

Regards,

James.

02/01/2018 21:46:27

Marcus,

Thank you for the observation about snippet one. It is obvious, now that you point it out, why that code never worked. Thank you.

In snippet two, I was trying to use State_of_Hours_Activator_LED = HIGH; to turn the LED on. It should then stay on for 150 ms, set earlier on in the programme in the variable Period_Each_Hour_Strike_On.

The next sequence -- if (Elapsed_Each_Hour_Strike_Time >= Period_Each_Hour_Strike_On) {State_of_Hours_Activator_LED = LOW; digitalWrite(Hours_Activator, State_of_Hours_Activator_LED);

calculates how long the LED has been lit and turns it off again. The while(number_of_strikes < 5) and while(number_of_strikes++ is meant to repeat it all.

Looking at it again, though, I think that the problem is to do with me not clearing or resetting the time variables correctly, meaning that the calculation is not working. The sequence works elsewhere in the programme, but, there, it only needs to work once, not repeatedly, hence not needing to be reset.

Regards,

James.

Edited By James Alford on 02/01/2018 21:47:57

02/01/2018 07:08:44

Neil,

I defined the variable number_of_strikes at the start of the programme and set it to zero. I did code the loop to print to screen the value of this variable and it was increasing to five and stopping at five correctly. What I could not make happen was to make the LED flash within the loop.

Progress will now slow down again as I am back to work today.

Regards,

James.

Thread: Web Site Software
02/01/2018 07:04:22

Harry,

I created a website of my own, and my friend's business website, in Serif Webplus, but found it very frustrating and limiting to use. I moved over to using Wordpress: it took a little to get used to it, but the effort was well worthwhile. It was a couple of years back now, so I cannot recall the full details, but I seem to recall copying and pasting most of the content from Serif into the new site.

A nice thing with Wordpress is that its appearance is largely controlled by themes; you can experiment by applying different themes to the same basic information to see which looks best.

Using Wordpress, from the company who host the sites, cost no more than it did for them to host the Serif sites.

My friend's site is fairly rudimentary and is easy to update: the address is www.oxfordshiresevens.co.uk if you want to have a look.

Regards,

James.

Thread: Arduino Uno Programming Assistance Request
01/01/2018 19:55:13

Dave:

Thank you for the latest code example. I have been playing with the oscillate, which is working as it is meant to. I also had a play with pulse, but with little success. I shall have a good read of the example that you have just posted and let you know how I get on.

Marcus:

I have to be honest: I am not sure whether I am using an interrupt or not, but as far a sI am aware, I am not doing so. The module is a DS 3281 and I am using the libraries DS3231.h.

Regards,

James.

01/01/2018 14:53:07

Dave,

Thank you. The pulse function would be more in line with what I am trying to achieve. I should like to activate the solenoid briefly to strike the chime, then pause it for a longer period to allow it to ring, before striking again. This will also conserve battery life.

I shall have a play with both oscillate and pulse, but should be grateful for any examples that you can provide.

Regards,

James.

01/01/2018 14:09:09

Dave,

Thank you for this code, which I shall have a play with. May I just ask, though: when using oscillate, does the LED light up for the defined period (1,000ms in this example), then extinguish for a 1,000ms for five cycles?

Regards,

James.

01/01/2018 12:15:54

Dave:

Thank you for the prompt reply and I should appreciate your observations on the second snippet.

As you guess, there are other operations going on that would be affected by using a delay. The clock, only partly designed so far, will use solenoids to operate seconds, minutes, hours, days, quarter strike and hourly strike mechanisms. I did try using a delay function, but it halted all of the other operations whilst waiting.

I have the quarter strike code working (I have built a test board with LEDs), but it is extremely crude and cumbersome.

Duncan:

Thank you for the suggested code, which I shall study and see whether I can adapt it.

Regards,

James.

01/01/2018 10:50:25

Good morning.

I wonder whether anyone can help with a question on programming an Arduino Uno?

I am writing a programme to operate a mechanical clock mechanism. The actual time is set by a plug-in RTC module. I want to make
the clock strike each hour, once at one o'clock, twice at two o'clock and so on. I am struggling with this part of the code. I have written one sequence
that works, but it is extremely cumbersome, so am trying to use a loop to make it more efficient.

There are two code snippets below, both trying to operate the LED five times.


Snippet One. This is what I am trying to use to make an LED flash five times, without using a "delay" function, and then to remain off. It turns on, but remains on.

Snippet Two. I have added code to try and make the LED turn off again after a preset duration. However, the LED does not turn on at all with this. All of the variables and constants have been defined. The same sequence to turn off the LED works elsewhere in the programme, but I cannot see why it does not work here.

I am going around in circles and should appreciate any constructive suggestions, including an alternative way to achieve the same objective.

Thank you.

James.
Snippet One
void Strike_the_Hour () {
unsigned long Present_Each_Hour_Strike_Time = millis(); // Sets the present time
Elapsed_Each_Hour_Strike_Time = Present_Each_Hour_Strike_Time - Previous_Each_Hour_Strike_Millis; // Calculates length of time that has passed since last event


while(number_of_strikes < 5){

State_of_Hours_Activator_LED = HIGH; // Activates the solenoid.
digitalWrite(Hours_Activator, State_of_Hours_Activator_LED);

number_of_strikes ++;
}
}


Snippet 2
void Strike_the_Hour () {
unsigned long Present_Each_Hour_Strike_Time = millis(); // Sets the present time
Elapsed_Each_Hour_Strike_Time = Present_Each_Hour_Strike_Time - Previous_Each_Hour_Strike_Millis; // Calculates length of time that has passed since last event


while(number_of_strikes < 5){

State_of_Hours_Activator_LED = HIGH; // Activates the solenoid.
digitalWrite(Hours_Activator, State_of_Hours_Activator_LED);

if (Elapsed_Each_Hour_Strike_Time >= Period_Each_Hour_Strike_On) {

State_of_Hours_Activator_LED = LOW; // Activates the solenoid.
digitalWrite(Hours_Activator, State_of_Hours_Activator_LED);

number_of_strikes ++;
}


}
}

Thread: UK Men's Shed of the Year 2017
28/12/2017 08:51:44

I popped into our local Men in Sheds a while ago. I was impressed by the enthusiasm and the vast variety of equipment that they had: wood working gear, computers, printing, 3-d printing, laser cutter, lathe, etc etc. Whilst I was there, they tried to sell me a rather nice lathe, with change wheels and all the fittings for £150.00............ tempting, I must say.

James

Thread: What people throw out amazes me
24/12/2017 09:22:11
Posted by J Hancock on 23/12/2017 20:09:01:

 

Same here in Grimsby.

Very reluctant to take anything 'worthless', car exhaust, waste oil, etc.

Somehow, it has to disappear.

 

 

Makes me realise how lucky we are here. Our local centres, across the county, have separate sections for card, paper, metal, green waste, clothes, shoes, oil, fluorescent tubes, general rubbish, rubble, soil, etc etc. The only restriction appears to be on asbestos where you can only dump about three roofing sheets per year, subject to a free permit and correct wrapping.

And no: I do not work for the tips..............

James.

Edited By James Alford on 24/12/2017 09:22:41

23/12/2017 19:15:10
Anything serviceable at our tip goes to a shop on site. It gets sold at fair prices and the money goes to the local hospice.
Thread: Britain invents worlds most advanced head protection technology
09/12/2017 09:05:58

My thoughts when I first read this were simply why on Earth do it in the first place?

James.

Thread: Brazing Brass
07/12/2017 07:20:32

Thank you for the suggestions. The rivets are temporary, to hold the repair plates in place whilst being soldered.

I have ordered some of the ComSol lead/silver solder from Cup Alloys, as suggested.

Regards,

James

05/12/2017 18:03:37

Thank you for all of the replies. I shall give up on the SifBronze as I have no desire to melt the actual radiator surround.

I some very old sticks of solder that have quite a high melting point, albeit far lower than the SifBronze, and shall try that instead.

Luckily, it is a purely cosmetic part that will be painted, so the rivet holes can be finished off with some sort of body filler, if needs be.

James.

05/12/2017 08:29:35
Bob.

I suspect that you have a point about overheating the flux. Thank you for the suggestion about washing up liquid.

Russell.

I have to admit that I was a little apprehensive about overheating the shell. It is a later style with the stamped badge. There is no chrome. I had considered soft solder, but was originally unsure whether it would be strong enough. I am swaying that way, though.

James
05/12/2017 07:11:29

I hope that someone can offer some advice.

I am repairing a brass radiator shell for an Austin 7. At some time in the past, the shell has been chopped and shortened; the joint has now failed.

I have made brass plates and riveted the parts together, having cleaned the parts with a wire brush first. I am using SifBronze flux powder (pink), number 1 rods and MAP gas to get the parts red hot.

On one side of the repair, the braze flowed well and has joined the parts, but on the other side, with the same technique, the braze simply sits on the flux, which has melted like glass. The braze is behaving like solder does on dirty steel with no flux.

I applied the flux as a dry powder; would mixing it to a paste with water or meths be likely to improve matters?

James.

Thread: How long does it take you to make stuff?
13/11/2017 07:13:58
Posted by SillyOldDuffer on 12/11/2017 15:04:50:

In my workshop and professional experience!

  • Hofstadter's Law: Work always takes longer than you expect, even when you take into account Hofstadter's Law.
  • Parkinson's Law: Work expands so as to fill the time available for its completion.
  • Sod's Law: If something can go wrong, it will.
  • Finagle's Law: If anything goes wrong it will do so at the worst possible time.

Dave

 

Bored at college one day, I sat and produced a mathematical formula to calculate the odds of Sod's Law applying in any given situation. Needless to say, I realised later that I had made a mistake in the formula and had to rewrite it.

James.

Edited By James Alford on 13/11/2017 07:14:40

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Support Our Partners
emcomachinetools
Eccentric July 5 2018
Allendale Electronics
ChesterUK
cowells
Warco
Eccentric Engineering
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest