Show Posts
Pages: 1 2 [3] 4
31  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 07, 2012, 01:30:23 am
Be reasonable, he's trying to help you. Detecting the presence of power is no guarantee that the PC is running the application you want. Also the buffer doesn't fill up just because there is no program at the other end reading it.

You haven't answered the reasonable question: why not send a message to the Arduino to tell it so start transmitting? That is the reliable way. Of course you need to send another message to tell it to stop later.

PaulS has a high post count because he helps a lot of people. Some aren't very helpful back. For example, they ignore his questions.
Regarding your question, "why not send a message to the Arduino". Honest, I was sure I said enough to explain it, well, if not, here is my more detailed explanation to you:
I have a program that receives data from COM port (without handshake) and "handles" input stream in a special way - it displays received numbers as a long diagram, that is, ECG (not necessarily, it might be EEG, or EMG, or what not), applies different filtration and peak detection algorithms and many more. 'Handles' means 'it does a lot of things with', is it more clear that way?
I can configure input port parameters - port number, speed etc, but I cannot modify program code to generate any "data transfer request", this program acts as a passive receiver.
I am using arduino board for interfacing different sensors with that program; it is also important to provide a possibility for Ard board to accumulate data in standalone mode, without connecting to PC. So if my code could determine that there is something , anything connected to USB port, then it would transmit sensor data; if not - data is logged on SD card.
I'm afraid I can't explain this obvious requirement more clear; besides, this is probably not that important. Point is, I am relatively new to this particular board and I had some sort of illusion there might be some hidden tricks I am not aware of.

32  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 06, 2012, 11:18:01 pm
Is meaningless trolling how you've got your 23<something> posts?
Stop it please, I hate trolling.
33  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 06, 2012, 10:58:57 pm
Yes it is.
So if USB is connected and your Arduino starts sending data, your PC will know what to do with it automatically?
What is most important, in such a case my Ard program will not start logging data on SD card.

I don't care for that sort of argument; I asked a question and it looks like there is no answer to it except but 'no can do'.
34  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 06, 2012, 10:42:15 pm
Yes it is.
35  Using Arduino / Programming Questions / Re: How to detect if the board is connected to PC? on: July 06, 2012, 12:23:49 pm
There is an obvious solution for this - like, make PC to send  some response when serial bytes  arrive, and detect this response with Arduino program; I don't want to use this approach.
Can you imaging a generic application that just listens to serial port and handles data regardless of what device is sending it?
There is nothing in the USB connection, if that is what you are thinking of, that defines whether the USB connector is receiving power only, or power and there is something on the other end of the serial port.
If USB is connected this is enough for me to know the board is connected to PC and to start serial communications.
36  Using Arduino / Programming Questions / How to detect if the board is connected to PC? on: July 06, 2012, 10:49:59 am
The board is collecting data from some sensor. I want it transmit the data to PC with Serial if it is connected to PC; if there is no connection, it should switch to logging data on SD card.
How I could detect programmatically if serial connection is available?
I see there is if(serial) function that does the thing, but only for Leonardo. How to achieve something like that with Duemilanove?
There is an obvious solution for this - like, make PC to send  some response when serial bytes  arrive, and detect this response wit Arduino program; I don't want to use this approach.
There might be also a possible solution with detecting power voltage, it looks rather unreliable and also requires some hardware arrangements.
Are there any programmatically only alternatives?
37  Using Arduino / Programming Questions / Please explain: scope resolution on: June 29, 2012, 11:56:06 am
Please explain in a very simple words these lines from some code example:
(,72739.msg546928.html#msg546928 )
#include <SD.h>
void Setup() {

this is what is confusing me:

1. What is 'SdFile' here and how is it related to SD library?
The first line includes SD library; Is SDFile some member or class or whatnot  from that library?

2. What exactly means a syntax like 'SdFile::<something>'?
can it be replaced with, f.e. 'SDFile.<something>'?

I see this used when creating a library, f.e.
void Morse::dot()
and it just means that dot() is a part of Morse class. But as I understand, this is used only when making library code; when we are using this library in a sketch, we use 'dot' notation, like
#include <Morse.h>
Morse morse(13);
void setup()
void loop()
So I probably understand that  the code above passes  callback function dateTime to dateTimeCallback(function?), defined within (SD? SDFile?)

So what exactly is the need of using SdFile::dateTimeCallback instead of
38  Development / Suggestions for the Arduino Project / Re: Board & shields design: lousy. This is just a shame. on: June 27, 2012, 08:21:28 pm
This is all nice and dandy. What it has to do with "Suggestions for Arduino Project"?
My suggestions:
1. Install on future Ard board mini-USB jack instead of current one
2. Change PCB design so that battery jack should be shifted forward ~ 0.1"
This will allow shield stacking in a nice and professional way.
39  Development / Suggestions for the Arduino Project / Re: Board & shields design: lousy. This is just a shame. on: June 24, 2012, 12:20:11 pm
The Arduino Ethernet doesn't in fact have a USB connector - it just uses
the FTDI pins.  The real irritation is the non-standard shield pin separation,
but now cranked pins are available you can build on 0.1 matrix boards
without problems.  Generally it all seems to work.


Will, many "arduinish" boards don't have USB and bulky power connector. My point is that the main, basic and most popular boards were designed even without minimal consideration on how the shield should be attached. It takes a minimal effort to fix it - install mini-USB and shift power connector forward 0.1" and the problem is solved - but it takes time, motivation and some effort. All this was missing. Hence, 'lousy'.
40  Development / Suggestions for the Arduino Project / Board & shields design: lousy. This is just a shame. on: June 22, 2012, 07:53:42 pm

Ard Duemilanove with shield.
Whoever came up with 'shields' idea - don't you guys realize this is very lousy design?
Change USB connector to  USB-mini and power connector to anything less bulky.
FEZ Panda has mini-USB, but still the same ugly battery connector  which does not allow  to connect any shield in a normal way.
With design approach like that you will always stay on  amateur's level
41  Development / Other Software Development / IDE 1.0 color scheme: boring on: February 17, 2012, 11:29:02 pm
Am I the only one who thinks the old color scheme was perfect and does not need any improvements?
If not, backup the content of lib\theme, remove all files and replace them from archived attachment. Enjoy.
42  Using Arduino / Storage / Which SD library to create file with date? on: September 18, 2011, 03:41:31 pm
I have  Adafruit datalogger shield with real-time clock.
I need create files on SD with correct file creation dates. As I understand, SD library recommended by Adafruit cannot create files with dates.
With so many SD libraries available which one I should stick to for creating a file with proper date?
43  Using Arduino / Sensors / Re: Accelerometer calibration: why it does not work? on: May 20, 2011, 10:28:58 am
Obviously not, as I understand it, those formula should work whith _any_ angle?
It is saying there 'The method presented here does not require any alignment with gravity'
That moment is somewhat unclear to me.
What actually means 'axis of sensitivity'? Sensor has 3 axis, and it seems that none of them is required to be aligned with gravity, .
Can you please explain it in more details?
Oh, I am starting to understand. Rotation effectively eliminates misalignment in vertical plane only,
or, rather, in a plane orthogonal to rotation axis smiley-sad
So to make it work for any angle, I must mount it on a cube and take 12 readings.
Thanks for a hint, johnwasser!
44  Using Arduino / Sensors / Accelerometer calibration: why it does not work? on: May 20, 2011, 09:59:36 am
There is a perfectly simple method for calibrating accelerometer offset and sensitivity using 4-points rotation.
The advantage is this method does not depends on the angle between sensor axis and g-axis.
The only problem with it is that it does not work.
Equations look correct and quite obvious.
Does anybody have an idea what is wrong in this method?
I simplified calibrating device. Instead of calibrated disks etc. I took a wooden bar with 2 inches sides, 20 inches long,  attached metal angle to one side, bent it so that angle's surface is at approx. 30-40degrees related to bar surface and mounted sensor on metal angle surface. Then I took sensor readings (averaged over 1000 values)  when turning the bar so that it stands on each of four sides, so this guarantees that measurements were taken on 4 'equally spaced angular positions' with 90 degrees difference. Readings were stable and permanent, and reproducible for each of four sides.
I calculated offset values using formula from the above source. The problem is when I re-mounted sensor under a different angle and repeated measurements, I get completely different values for offset and sensitivity.

So there is a flaw somewhere in this approach; besides it looks very obvious and simple, but I never met this method described anywhere else, which makes me to suspect there are some reasons why it is not used.
Any ideas?
45  Using Arduino / Installation & Troubleshooting / Re: IDE 0022 Serial monitor bug? on: April 24, 2011, 05:29:34 pm
Definitely not a cable, just tried another one, brand new with same result. Well, then it is only one reason: my board smiley-sad
Probably some glitch in communication chip. Unfortunately, I don't have another board to compare. But it also proves Arduino serial monitor is not 'resilient' enough compared to every other serial monitors:(
Thanks for your time, man!
Pages: 1 2 [3] 4