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

Member postings for Bob Burton

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

Thread: Arduino Software Help Using an EDF
15/03/2017 13:45:25

In the Arduino environment HIGH and LOW are defined as 1 and 0 respectively but using HIGH and LOW instead off 1 and 0 makes the code more readable.

In very much the same way true and false are defined as 1 and 0, but true and false make more sense. In fact any positive non zero value will return true if tested. Note that despite only having a value of 0 or 1 boolean variables are in fact 8 bits (ie one byte) in size.

Comparison with HIGH and LOW does not need to use a boolean variable, it can be used with any integer data type as the comparison is really with 1 and 0

It is possible, but highly unlikely, that at some time the definitions of HIGH, LOW, true and false could change. It would be possible to have HIGH defined as say 123 and LOW defined as 121 in which case comparisons with HIGH and LOW would still work but comparisons with 1 and 0 would not.

15/03/2017 10:35:12

OK. Found the problem. Here is release 2.0 of the software. Tested with a servo

#include <Servo.h>
const byte buttonPin = A0;
byte currentSwitchState;
byte previousSwitchState;
Servo theESC;
boolean escOn = false;

void arm()
{
// arm the speed controller, modify as necessary for your ESC
Serial.println("arming";
theESC.write(30);
delay(2000);
theESC.write(90);
delay(2000);
Serial.println("armed";
theESC.write(30);
delay(2000);
}

void setup()
{
Serial.begin(115200);
theESC.attach(9);
pinMode(buttonPin, INPUT_PULLUP); //turn on built in pullup resistor
arm();
}

void loop()
{
previousSwitchState = currentSwitchState;
delay(100); //crude debounce
currentSwitchState = digitalRead(buttonPin);
if (currentSwitchState != previousSwitchState) //button state has changed
{
if (currentSwitchState == LOW) //button is pressed
{
escOn = !escOn;
if (escOn)
{
Serial.println("ON";
}
else
{
Serial.println("OFF";
}
}

if (escOn)
{
theESC.write(180); //full speed
}
else
{
theESC.write(0); //stop
}
}
}

Do you want the output to ramp up or is instant start OK ?

14/03/2017 20:45:34

I deliberately took out the run up sequence to keep things simple to start with. Once the toggle on/toggle off is working then features can be added back if needed.

Tom's original requirement was

" when a button is pressed the EDF runs at max speed and when the button is pressed again the EDF stops."

No mention of a slow start so I don't know whether he wants that or not. Easy enough to add if required.

Thread: Sandbox
14/03/2017 20:06:34

Another test
A TEST);

14/03/2017 20:05:39

Testing
[code]

A TEST );
[/code]

Thread: Arduino Software Help Using an EDF
14/03/2017 19:47:54

OK. Give this a go

#include <Servo.h>
const byte buttonPin = A0;
byte currentSwitchState;
byte previousSwitchState;
Servo theESC;
boolean escOn = false;

void arm()
{
// arm the speed controller, modify as necessary for your ESC
Serial.println("arming";
theESC.write(30);
delay(2000);
theESC.write(90);
delay(2000);
Serial.println("armed";
theESC.write(30);
delay(2000);
}

void setup()
{
Serial.begin(115200);
theESC.attach(9);
pinMode(buttonPin, INPUT_PULLUP); //turn on built in pullup resistor
arm();
}

void loop()
{
previousSwitchState = currentSwitchState;
delay(100); //crude debounce
currentSwitchState = digitalRead(buttonPin);
if (currentSwitchState != previousSwitchState) //button state has changed
{
if (currentSwitchState == LOW) //button is pressed
{
escOn = !escOn;
if (escOn)
{
Serial.println("ON";
}
else
{
Serial.println("OFF";
}
}

if (escOn)
{
theESC.write(180); //full speed
}
}
else
{
theESC.write(0); //stop
}
}

Remember, the smilies are a closing bracket and a semicolon.

NOTE:

I used the same arming sequence as the original code although I removed the setSpeed function
The button needs to be wired to take pin A0 to GND when pressed
The code activates the built in pullup resistor to keep the input in a known state
Be careful when you run this with a motor attached as the logic may be reversed so expect the unexpected

I don't have an ESC and motor or a servo handy to test the code, but the output to the Serial monitor produces the expected ON/OFF messages

Let me know how it performs, or if it doesn't !

14/03/2017 19:35:40

The wink smiley is a close bracket followed by a semicolon and that sequence appears in the code, hence the smilies

14/03/2017 19:10:47

Belay the question about pin 9 !

14/03/2017 19:00:39

Ok. I can see what is wrong and I will try to find time to fix it later this evening, but no promises, so it may be tomorrow.

What is connected to pin 9 ?

14/03/2017 18:51:54

Tom

I will take a look but the forum software has turned some of your code into smilies but I should be able to determine what was really there.

Thread: Fusion 360 for modellers
11/03/2017 18:07:11

I'm interested in Fusion so will keep an eye on this thread.

Thread: Am I drinking too much?
20/02/2017 18:55:25

Well done Ted. Keep up the good work.

15/02/2017 07:36:33

Ted - that is way too much. Get some help now.

Thread: Charging
21/01/2017 18:59:54
Posted by Simon Chaddock on 21/01/2017 15:19:55:

Diamond G

If as I assume the batteries are all connected in parallel then you set the charge rate to a maximum of 6 time the individual battery charge rate.

However unless you are sure all the batteries are at roughly the same level of charge it might be prudent to set it a say half that to avoid the condition where the lowest charge battery gets a 'heavy' charge until its voltage has risen to the same level as the others.

Won't the cells almost instantly be at the same voltage as soon as they are plugged in because they are in parallel, so they will all get the same charge current. That is not to say that as far as possible all of the cells should be at or near to the same voltage before plugging them in.

Thread: BAT-SAFE
12/01/2017 14:16:08

Also available from HobbyKing, but it looks childish from any source.

I also find it ironic that the HK product page for this items advises that batteries should not be left unattended whilst charging, when the box is clearly designed to make leaving them unattended safer

 

Edited By Bob Burton on 12/01/2017 14:20:29

Thread: French Balsa designations on Plans
11/01/2017 10:40:55
Posted by brokenenglish on 11/01/2017 10:17:47:

Think of it as "tenths of a millimetre".

20/10 is 2mm, 30/10 is 3mm

It's a traditional French method of expressing sheet thickness (it's not used for strip), and it's not only balsa either, it's also used in engineering for metal plate thickness.

Tenths of a millimetre ? Micro modelling at its best !

Tenths of a centimetre perhaps ?

Thread: hobbyking - big changes
07/01/2017 14:12:58
Posted by Dave Bran on 07/01/2017 12:44:38:

Worth the effort? Try to get a 250 Flybarless Head or 250 FBL head or any normal search engine variants (from ANY warehouse) and see what it offers!

I'm not only hesitating, I'm def not bothering to TRY searching any longer.

How about doing a Google search ?

Put this into Google: 250 Flybarless Head site:hobbyking.*

Thread: Amazon flying warehouses
29/12/2016 17:18:11

How long is the drone going to take to descend 45,000 feet then ascend back to the mothership ?

29/12/2016 17:03:31

Amazon are at it again, but can they be serious ?

**LINK**

Thread: Amazon completes first Prime Air delivery in Cambridge
14/12/2016 18:01:33

I can't see how Amazon managed this flight and stayed compliant with the ANOs bearing in mind the requirement to keep the aircraft in sight of the person controlling it or a competent observer at all times.

Support Our Partners
Sussex Model Centre
Slec
CML
electricwingman 2017
Advertise With Us
Sarik
Latest "For Sale" Ads
NEW POLL - has the pandemic altered your event safety perceptions?
Q: Has the covid pandemic deterred you from attending shows and events in 2021?

 No, I'll be attending just as many as I usually do
 No, but I'll choose my event with greater care
 Yes, I'll attend fewer events going forward
 Yes, I wont attend any where previously I have

Latest Reviews
Digital Back Issues

RCM&E Digital Back Issues

Contact us

Contact us

Magazine Locator

Want the latest issue of RCM&E? Use our magazine locator link to find your nearest stockist!

Find RCM&E!