Show Posts
|
|
Pages: [1] 2 3 ... 2363
|
|
2
|
Using Arduino / Programming Questions / Re: Web server, How to make a simple button to reset a counter??
|
on: May 17, 2013, 06:16:59 am
|
I am not very good with all the terminology, Especially with this web server stuff as I have never done it before.
Imagine that you work in a fast food restaurant. A client comes in, and orders a chicken sandwich and onion rings. You cook a cheeseburger and french fries. The next client wants a tuna sandwich and cole slaw. You cook a cheeseburger and french fries. See a problem? The "You get it our way!" sign needs to be prominently displayed (right next to the going out of business sign). Actually paying attention to what the client wants is a good thing.
|
|
|
|
|
4
|
Using Arduino / Programming Questions / Re: Same code works and it doesn't
|
on: May 17, 2013, 06:05:53 am
|
Wire.requestFrom(DEVICE_ADDRESS, 1);
uint8_t test; while (Wire.available()) { test = Wire.read(); } While I2C is fast, you seem to be under the mistaken impression that it is instantaneous. When you get over that, I predict you'll have better results. Instituting callbacks, to be called when the data IS available is preferred. Not discarding results, in case the slave has a better idea how much data to return is preferred, too.
|
|
|
|
|
5
|
Using Arduino / Programming Questions / Re: Arduino PreProcessing.
|
on: May 17, 2013, 05:59:23 am
|
I need to get the pure C code and then compile it. First, you misspelled C++. Second, compiling the code is not sufficient. You must also link it for the appropriate Arduino and upload it to the Arduino. Is your tablet capable of those last two steps?
|
|
|
|
|
6
|
Using Arduino / Programming Questions / Re: client.connect() causing watch dog trip.
|
on: May 16, 2013, 02:42:18 pm
|
Is there a way to modify the time out for connect()? The code for the connect method that actually gets used: int EthernetClient::connect(IPAddress ip, uint16_t port) { if (_sock != MAX_SOCK_NUM) return 0;
for (int i = 0; i < MAX_SOCK_NUM; i++) { uint8_t s = W5100.readSnSR(i); if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT || s == SnSR::CLOSE_WAIT) { _sock = i; break; } }
if (_sock == MAX_SOCK_NUM) return 0;
_srcport++; if (_srcport == 0) _srcport = 1024; socket(_sock, SnMR::TCP, _srcport, 0);
if (!::connect(_sock, rawIPAddress(ip), port)) { _sock = MAX_SOCK_NUM; return 0; }
while (status() != SnSR::ESTABLISHED) { delay(1); if (status() == SnSR::CLOSED) { _sock = MAX_SOCK_NUM; return 0; } }
return 1; }
You'd need to add a timeout to the last while loop to not block forever.
|
|
|
|
|
8
|
Using Arduino / Programming Questions / Re: DateFormat
|
on: May 16, 2013, 02:30:22 pm
|
Which library should I include? Probably not the MIDI library. A clue would be helpful. Something that caused you to believe that such a library exists, for instance.
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Re: Reading encoder gives very strange results using the encoder library
|
on: May 16, 2013, 02:04:51 pm
|
So, could anybody please tell me what goes wrong? No. What is that output supposed to be telling anybody? A bunch of names followed by a bunch of values? It would make more sense to output name = value pairs, AND show the code where the name = value stuff gets printed. Using names like _input and input in the same code shows a clear lack of design. No variable should EVER be named input. Doing so means that you haven't a clue WHAT the input is, which means that haven't a hope of solving a real-world problem. Sorry to be so harsh, but sometimes life just is that way. There is no need to resort to names like _input and input, for any reason. If you REALLY think you need to, then call them local_input and class_input, just to illustrate that you can't think of better names.
|
|
|
|
|
10
|
Using Arduino / Programming Questions / Re: "Does not name type" SwitecX25 library
|
on: May 16, 2013, 01:49:58 pm
|
:facepalm: It took me writing out this reply to remember that I have to "unhide" the file extensions to be able to manipulate them That has got to be, beyond a shadow of a doubt, the absolutely dumbest idea Microslop EVER had. No one else thinks that hiding extensions is even remotely close to a good idea.
|
|
|
|
|
11
|
Using Arduino / Programming Questions / Re: error: unknown escape sequence '\c' problem
|
on: May 16, 2013, 01:47:07 pm
|
Maybe i should search for a USB-COM port sniffer but i would like to see it realy happening in my Arduino As has been suggested, printing the HEX value is the most useful thing to do. You should forget that the LCD.write() function exists. For all intents and purposes, it will do nothing but screw with your LCD. Don't use it. Printing "<cr>" or "<lf>" or "<shit if I know>" makes sense. Attempting to make stuff happen using escape characters OR forward slashes is a waste of time. Don't bother.
|
|
|
|
|
15
|
Using Arduino / Programming Questions / Re: client.connect() causing watch dog trip.
|
on: May 16, 2013, 07:55:55 am
|
I guess I am wondering if there is any way to modify this of some library to time out when it cant make a connection. Modify "this" what? The EthernetClient::connect() method DOES time out if a connection can not be made. It may not time out soon enough for you. In which case, I advise not hard-coding a bad domain name. 
|
|
|
|
|