Go Down

Topic: Will Arduino team ever do better than this?! (Read 12879 times) previous topic - next topic

robtillaart

Another nice read - ftp://ftp.ti.com/pub/data_acquisition/MSC_CD-ROM/C_Programming/Embedded_C_Traps_and_Pitfalls.pdf -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

retrolefty


Another nice read - ftp://ftp.ti.com/pub/data_acquisition/MSC_CD-ROM/C_Programming/Embedded_C_Traps_and_Pitfalls.pdf -



Bad link?

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

retrolefty


the forum adds http:// automatically to the link , sorry

ftp://ftp.ti.com/pub/data_acquisition/MSC_CD-ROM/C_Programming/Embedded_C_Traps_and_Pitfalls.pdf
this might work better



Still doesn't resolve for me?

Quote

The server at ftp can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.

robtillaart


change ftp at the start to ftp:
somehow  the : got lost
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pYro_65

#35
Jun 30, 2014, 12:41 pm Last Edit: Jun 30, 2014, 12:57 pm by pYro_65 Reason: 1

Good and interesting analysis Pyro!

Still imho mixing datatypes (int and bool(ean)) is always tricky.
With comparing integer with booleans we loose "significant truth" bits.

similar as loosing significant digits when converting long to float and or vice versa.

So in the end the programmer is responsible to know the limits of a language
(see book safer C from Les Hatton)



I'm not sure what you mean in the highlighted part. However there are pretty concise rules governing these conversions ( int & bool ). There is nothing left up to interpretation.

And I agree the programmer is responsible however, its failure waiting to happen, as the Reference a knowledgeable Arduino user would refer to is wrong. But in this case, fixing the reference is not good enough.  I mentioned earlier that the defines true and false did not affect anything, however I was wrong, these must go too.

I have started a thread regarding this issue if you are interested ( and everyone else ). I have also made some posts describing the nitty gritty of boolean conversions.

The thread is located here: http://forum.arduino.cc/index.php?topic=252120
Forum Mod anyone?
https://arduino.land/Moduino/

liuzengqiang

Back to blaming arduino, another thing I discovered the hard way:

http://arduino.cc/en/Reference/WiFiClientConnected

Quote
Note that a client is considered connected if the connection has been closed but there is still unread data.


You think that you will take their word for it?! I did and lost 8 hours of work on it. It was intense trouble shooting. This above line simply isn't implemented in their latest code and an older version of the code didn't work either. The sample code on the page is not working either. Also not working with latest IDE and firmware. The call with return FALSE even when there are still available characters, so you end with a partial server response or just the first few characters. If you open connection again you get the rest of the response glued to the next response. I posted as separate thread on this board since they ask everyone to post here in case or ref page error. I seriously doubt they monitor the software dev. board for any sort of improvement suggestions.

This time there is a simple solution: just add available() to your if (!connected()) you will do fine.

Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

Go Up