Show Posts
Pages: 1 ... 36 37 [38] 39 40 ... 67
556  Using Arduino / Project Guidance / Re: HTML Server Web Pin Control on: December 24, 2012, 10:23:37 am
If the lines were fixed-length you could use lseek() to set the file pointer to a computed length and write a fixed-length record there.

Real program lines haven't been fixed-length since the Hollerith days, so the practical answer is "not really", since you don't know how long the line you are overwriting is.

-br

557  International / EspaƱol / Re: concatenar numeros on: December 24, 2012, 07:39:45 am
Code:
    numero = numero * 10 + nuevo_digit;

-br
558  Using Arduino / Microcontrollers / Re: attiny85 serial monitor on: December 22, 2012, 06:34:14 am
There is a limit on the operating clock speed based on VCC.  Higher speeds are not possible at lower voltages.  There's a chart in the datasheet, I believe.

Anyway, it's possible you experimentally determined the limit.  I'd be curious to know what speed are you running the '85.

-br
559  Using Arduino / Project Guidance / Re: Is there a way to send more than 64 characters at a time through serial? on: December 21, 2012, 05:34:37 pm
Well, you can read about circular buffers with a little searching.  But basically it's the same thing the Serial object is doing for you: you keep an array or buffer, and there is a head and a tail pointer.  You push things (serial characters) in at the head and pull them out at the tail as the consuming process requires them.  There is sample code around line 165 at that URL I pasted above.

You would pump characters from the serial buffer into this new buffer, and play morse out the other end of the new buffer.

It may be easier to increase the size of the Serial buffer.  Or implement some flow control between the sending computer and the Arduino, perhaps like send-a-line-and-wait-for-prompt.  That's how Bitlash does it.  The circular buffer is there so that Bitlash can do other things while the Morse plays out in the background.

-br
560  Using Arduino / Project Guidance / Re: Is there a way to send more than 64 characters at a time through serial? on: December 21, 2012, 05:16:43 pm
You might make your own circular buffer and "decant" the serial input buffer into yours.  It can be any size you like.

There's an example here, also with morse output: https://github.com/billroy/bitlash/blob/master/examples/morse2/morse2.pde

-br
561  Using Arduino / Programming Questions / Re: Does this work on: December 21, 2012, 06:48:20 am
Send the device something it actually expects, and check the return for the predicted value.  Studying the data sheet for the device is the first step.

-br
562  Using Arduino / Interfacing w/ Software on the Computer / Re: PHP fread arduino serial com doesn't work. PLEASE Help!!! on: December 20, 2012, 01:10:51 pm
You are probably a victim of the bootloader timeout.

Opening the serial port resets the arduino.  There is a two second period after you open the port from PHP during which your program is not yet running.  If you send data during this window, the bootloader eats it.

In the PHP code it appears you write to the serial port immediately after opening it.  Try waiting two seconds after the open and see if it helps.

-br

563  Using Arduino / Programming Questions / Re: Finding array's linear part on: December 20, 2012, 11:12:20 am
If it's linear, it doesn't matter how many elements you use, right?

I don't think you want to get into calculating piecewise linear regressions of all contiguous subsets of the data, but that's the hammer you'd use in a formal statistical analysis.

Often the central tendency tells you enough to get the job done.  Speaking of which, what is this for?  It might help understand your requirements better.

-br
564  Using Arduino / Programming Questions / Re: Finding array's linear part on: December 20, 2012, 10:36:21 am
You're going to need to look at a lot of data from your sensor to figure out the right answer.  But why not just use the middle three elements of the sorted array as a first guess?

-br
565  Using Arduino / Programming Questions / Re: Pin 10 is HIGH. WHY? on: December 20, 2012, 09:55:28 am
The fast fix is three characters: // right before that digitalWrite, followed by Upload.

Patch the SPI library and you're done.  It is not written in stone, nor even in the datasheet, that pin 10 must be used as the slave select, provided that it is initialized as an output, which it safely is.

-br
566  Using Arduino / Interfacing w/ Software on the Computer / Re: 2 way serial arduino to vb6 on: December 20, 2012, 08:11:12 am
Have we ruled out a problem on the sending side?

Opening the serial port from the PC side resets the arduino.  The Arduino isn't running your program for a couple seconds after reset.  So, if you open the port and write to it right away / without a delay, some  of the sent output gets dropped on the floor (by the bootloader).

If you don't delay after opening the port, it might be worth a try.  And could you post your whole sending-side code?

-br
567  Using Arduino / Project Guidance / Re: Sending Arduino data over to another pc on: December 20, 2012, 07:35:13 am
It might be worth taking a look at Bitlash Commander, at least for the architecture:

https://github.com/billroy/bitlash-commander

Commander runs a little web server on your PC that also talks to the Arduino through the usb serial link.  You can build web based control panels for Arduino and control them from a PC on your network.

-br
http://bitlash.net
568  Using Arduino / General Electronics / Re: ADC on: December 20, 2012, 06:32:43 am
"Board on fire", code 0x15.

Seriously: negative voltages on the inputs can damage your Arduino.  There are techniques to transform the voltage into something Arduino can use; search the forums for "level shifting" for one approach.

-br
569  Using Arduino / Project Guidance / Re: HTML Server Web Pin Control on: December 19, 2012, 06:54:57 pm
The web server does not have to be on the internet.  It can be on the phone, or a PC, on your local network.

-br
570  Using Arduino / Project Guidance / Re: HTML Server Web Pin Control on: December 19, 2012, 06:32:28 pm
The problem is the file:// url.  There is a great difference between http:// and file:// urls.  The main issue here is that a file:// url is only valid on the device where the resource named by the url lives.

To fetch a resource like an image across the network, it needs to be on an http:// server and the referring HTML code needs to use the appropriate http:// url to fetch it.

-br
Pages: 1 ... 36 37 [38] 39 40 ... 67