Show Posts
Pages: 1 ... 97 98 [99] 100 101 ... 114
1471  Using Arduino / Programming Questions / Re: Abstract base class on: March 13, 2012, 07:28:13 am
Hi,
   If you overload the function prototype, the assumption is that the caller knows this, what the OP is looking for is to abstract the different hardware so that the caller does not need to know these details.

OP, correct me if I am wrong and you want you callers to know that they have to pass or receive different data types for different devices ?

Duane B

rcarduino.blogspot.com
1472  Using Arduino / Programming Questions / Re: Abstract base class on: March 13, 2012, 07:09:33 am
Hi,
   You can return different 'data' this way, but not different 'data types'. I assume you meant different data.

Duane B

rcarduino.blogspot.com
1473  Using Arduino / Motors, Mechanics, and Power / Re: Controlling speed of motor that is being powered directly off battery on: March 13, 2012, 06:59:58 am
Hi,
   If the motor is being powered from a LIPO and is a high powered motor, it has the potential to draw 100's of amps. My RC Motors driven from 2 cell LIPOs are able to draw continuous current of over 70 Amps and start up and stall currents in the low to mid 100's.

   If the motor is drawing these levels of current a quick solution might be to drive a cheap off the shelf RC Electronic Speed Controller from the Arduino.

This project uses a 30 dollar speed controller and Arduino to control a motor thats good for 40Km/h or potentially a lot more in a car with larger tyres and higher gearing.

http://rcarduino.blogspot.com/2012/01/traction-control-part-13-we-have.html

Duane B

rcarduino.blogspot.com
1474  Using Arduino / Motors, Mechanics, and Power / Re: Servo problem (it doesn't turn good) on: March 13, 2012, 03:47:51 am
Hi,
   I haven't read the servo specs, so don't know if it has a limited range. You could try using writeMicroseconds instead of write. This may give you a larger range. If you check in Servo.h you will see the min and max values allowed for writeMircoseconds, this should give you access to the full range of motion if it is not limited somehow within the servo.

Duane B

rcarduino.blogspot.com
1475  Using Arduino / Sensors / Re: IR leds and 38KHz receivers as a optoencoder or similiar on: March 13, 2012, 03:45:02 am
Hi,
   This hack has just occured to me -

1) When the IR Receiver you are using detects a valid 38Khz signal, it initially changes its output to show it has a valid signal
2) Shortly afterwards it will change back because the continuous 38Khz signal is not within the signal rules (page 5 of the datasheet)
3) From this point onwards, the receiver will ignore the presence of the 38Khz signal

Now for the hack -

If someone happens to walk in front of the receiver, it breaks the continuous 38Khz signal briefly.

As soon as the person passes and the receiver picks up the 38Khz again, it assumes - 'Hey this is a good 38Khz signal' until after a short period it realizes - 'No, its not'. The good news is that during the brief 'Hey this is a good 38Khz signal' the output will change allowing you to count traffic.

Its a bit of a hack, but it is based on a valid interpretation of the datasheet.

Using this method you could use a separate 555 timer to generate the constant 38Khz signal, this would free you from running wires between the transmitter and receiver.

Duane B

rcarduino.blogspot.com



1476  Using Arduino / Sensors / Re: IR leds and 38KHz receivers as a optoencoder or similiar on: March 13, 2012, 02:46:36 am
Hi,
   The best advice at this point is to get on and do it, when you have problems come back, but try and see how far you can get first.

   The first thing you will need to do is generate the 38Khz signal, you can do this on Arduino, there are lots of code examples for using the timers to do this.

EDIT: As Chargin has mentioned already, there are some restrictions on the type of signal the IR Detector will accept. You can see these on page 5 of the datasheet you linked. I suggest that you do the maths on some of these restrictions and determine whether you think this device is suitable for your application.

Duane B

rcarduino.blogspot.com
1477  Using Arduino / Motors, Mechanics, and Power / Re: Servo problem (it doesn't turn good) on: March 13, 2012, 02:40:39 am
Hi,
   You do not need to calibrate the Servo library and I cant see why you would need to calibrate this servo either.

Did you write your own code or use the servo sweep example ? - I suggest that you use sweep as the initial test.

Did you connect a common ground between the servo and your arduino ?

How are you powering the servo ?

Duane B

rcarduino.blogspot.com
1478  Using Arduino / Project Guidance / Re: best way to extend serial lcd connectors off the protoboard on: March 13, 2012, 02:32:31 am
Hi,
   I use old parallel cables soldered to PCB Headers, the allows me to quickly plug and unplug projects without having to think where each individual wire should go. This should work over the distances you have mentioned.





Duane B

rcarduino.blogspot.com
1479  Using Arduino / Programming Questions / Re: Object oriented or not? on: March 11, 2012, 07:39:16 am
Hi,

Quote
Fine. But, if the job was to develop code for embedded processors, and your app consumed 4 GB of ram, that would not then scale to the intended job target.

Quite right, I am always open to changing my mind, so would anyone like to offer some great examples of OO being used to build projects by forum members, thats OO, not here is a class in a library.

Duane B

rcarduino.blogspot.com
1480  Using Arduino / Programming Questions / Re: Object oriented or not? on: March 11, 2012, 07:16:57 am
Hi,
   Based on the examples within this branch of the forum, most people that attempt to write OO for Arduino tend end up to writting the problem to fit the solution. Maybe you can write great OO for Arduino but OO requires more than a collection of standalone libraries created as classes.

   If I was taking a test as part of a job interview and the test was - 'write something that makes elegant use of OO to solve a problem' and I was offered a PC or an Arduino, I would take the PC.

   As the OP is looking for confirmation on an approach for a college project he is in a similar situation and my advice to him/her is the same I would give myself.

Duane B

rcarduino.blogspot.com



   

1481  Using Arduino / Programming Questions / Re: Object oriented or not? on: March 11, 2012, 06:04:24 am
Hi,
   Lets wait and see what the OP comes up with ...

Duane B

rcarduino.blogspot.com
1482  Using Arduino / Programming Questions / Re: Object oriented or not? on: March 11, 2012, 05:43:20 am
Hi,
   All of which are already provided, I have no idea whats expected of students these days, but presumably more than just using some existing libraries or writing a single standalone class and calling it OO.

Duane B

rcarduino.blogspot.com
1483  Using Arduino / Programming Questions / Re: Object oriented or not? on: March 11, 2012, 05:25:06 am
Hi,
    I thought I would wait for someone else to put their head above the trench first, but yes I would agree with westfw that Arduino is probably not the best environment to showcase your OO skills.

Duane B

rcarduino.blogspot.com





1484  Using Arduino / Programming Questions / Re: Function() vs Speed on: March 11, 2012, 03:39:37 am
Hi,
    Thanks, seems reasonable enough and further reinforces the point - 'make it so you can read it and let the compiler worry about the rest'

    Duane B

rcarduino.blogspot.com
1485  Using Arduino / Programming Questions / Re: Function() vs Speed on: March 11, 2012, 03:17:52 am
Hi Chaps,

    I am still a little confused. In the case of a non trivial function, lets assume that its sufficiently complex to require half of the available registers -

1) Is the compiler sophisticated enough to only push/pop the required registers

and

2) If yes to 1) why is it not smart enough to do the same for and ISR ?

Duane B

rcarduino.blogspot.com
Pages: 1 ... 97 98 [99] 100 101 ... 114