Trying to get an older file to work with Arduino 1.0.1, get this error,
"As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead." Trying to write to an LCD and can't find how to replace Byte with anything for that. I know I've read it, but search just finds thousands of hits for "byte", obviously not the same thing.
When I write code for the LCD now, I just use quotes or variables, no other command is necessary, can i just use a "search and destroy delete" method here?
Here is the first line that returns the error
lcd.print(4, BYTE);
Thanks, I know this has been answered before, but I can't find it today.
TomJ
Thanks Majenko,
Couldn't get back on for hours for some reason.
So I take it
lcd.write(4); and
lcd.print(4);
are the same?
I use the lcd.print all the time (without the BYTE keyword) and it works fine.
Anyway, I tried it as lcd.print(4); and it compiled, just have to change everything to a 16,2 display from a 20,4 that was in the original code and fire it up.
TomJ
So I take it
lcd.write(4); and
lcd.print(4);
are the same?
No, they are not. Why do you assume that they are? Have you read the documentation on the print() and write() methods? The documentation explains the differences. The write() method sends binary data to the serial port. The print() method converts the value to a string and sends that.
Hey, I said it would be obvious to the experts here. If no one can ask simple/ignorant/uninformed questions here, then they might as well shut down the whole forum.
By the way, I had figured it out on my own when the output wasn't what I expected.
Tumbleweed:
Hey, I said it would be obvious to the experts here. If no one can ask simple/ignorant/uninformed questions here, then they might as well shut down the whole forum.
By the way, I had figured it out on my own when the output wasn't what I expected.
And there is little reason to feel that you are being put down or singled out for not reading the documentation. The problem is that many of the problems that newcomers have with their early sketch attempts revolve around arduino written functions that are unique to arduio, so you will have little luck looking for help at more traditional C/C++ manuals and references. The following link ( Arduino - Home )is the FIRST place you should look at if a function is not working as you think it should. Note also that in the bottom right of that page is a link that contains the documentation for many more of the arduino provided library functions.
When I first started with an arduino board and trying to learn C, I found the most useful way for me to learn was to study the many many example sketches that are included in the IDE under files options. More formal documentation works better for some, but finding what works best for you is part of the learning journey your on.
Yeah it IS... I have Prata's books on C & C++ and "A Book on C" and I get so confused I sometimes just want to quit reading anything. Beyond the real basics, precedence and basic rules of syntax and "grammar" they are more confusing than they were really worth. For all the good I got from "A Book..."
I could have checked it out of the library and been done with it in a week... Instead of paying $18.++ for a really used book.
cout << "I Quit" << end1; ... printf(%s.... REALLY useful stuff. Struct's Unions and Enumerators... Pointers...
I finally realized they were a LOT more complicated than values and addresses...
Still makes me "Slightly Crazy" and I force myself to read 2 hours a day... Too.
I now know slightly more C & C++ than could be legibly engraved on the head of a Pin... And as was pointed out I learned 95% of it in the forum and a couple of Arduino specific books.
Docedison:
Struct's Unions and Enumerators... Pointers... I finally realized they were a LOT more complicated than values and addresses... Still makes me "Slightly Crazy"
and I force myself to read 2 hours a day...
Doc
Heh...
I started programming with C in around 1990.
I only truly got to grips with pointers and such about 5 years back. I still get confused by them sometimes even now.
Docedison:
and I force myself to read 2 hours a day... Too.
Spend less time reading, and more time writing. That's how you really learn. Spend those 2 hours a day writing actual code (and, of course, getting it to actually work as well) and you'll learn a whole lot more.
Docedison:
and I force myself to read 2 hours a day... Too.
Spend less time reading, and more time writing. That's how you really learn. Spend those 2 hours a day writing actual code (and, of course, getting it to actually work as well) and you'll learn a whole lot more.
But that's what he's doing with the other 22 hours
Docedison:
Struct's Unions and Enumerators... Pointers... I finally realized they were a LOT more complicated than values and addresses... Still makes me "Slightly Crazy"
and I force myself to read 2 hours a day...
Doc
Heh...
I started programming with C in around 1990.
I only truly got to grips with pointers and such about 5 years back. I still get confused by them sometimes even now.
Having come from a hardware machine language background the concept of pointers were very simple to me. Pointers are just variables that contain memory addresses rather then containing data values directly. Indirect addressing used in machine language is the same concept. The inclusion of pointers in the original C language is one of the things that made C such a powerful 'low level' language and could compete with assembly language. That being said, I have had no use to actually use pointers in any of my arduino sketches so I would most likely trip up badly actually trying to utilize pointers successfully.
I've always found reading other people's programs was much more useful to me then to just tackle a reference manual from start to finish. Seeing functions and expressions written in context and used in a complete program just seems more useful to me rather then trying to tackle such in isolation. So I would load an example sketch and start reading it and if anything that seemed new or strange or unexplainable to me would then give me a context in which to search out a reference to help in 'decoding' what it does and how it does it. Works for me, maybe not for others.
Lefty, that is exactly the way I learned. I got/get comparatively little from what I read relative to the Arduino. I however do have a Renassas low power Dev Kit, a STM32 dev kit and one of those Motorola MSP430 dev kits, I was hoping to learn the language from the Arduino so as to have an "easy" jump start to a more "complete" language set. Instead I fear I''ve just painted myself into an interesting corner, A corner nevertheless.
What of the "New" Arduino... my understanding so far is that it will support a more complete language set, certainly a different programming environment than an Uno Or a Mega (An UNO on steroids?). What import will the "Xmega" chips have on this scenario and is there any thought of comparability from the new "Arduino" to the products that exist now. What of the IDE, 1.01 is in some ways better BUT it still lacks a great deal.
All in all it will be an entertaining year but I don't see spending my time on anything as crippled as the Arduino. It is my impression that the Arduino was intended more as a teaser to get the young interested in computer science... however the money spent on the Arduino isn't trivial and for the most part IMO not the best investment a youngster could make. Only the bare essential peripherals are really re-usable and for a lot of them, why bother because with a better MCU the parts become as they were before the Arduino Craze,,, Stagnant Surplus with little market. Who would want to pay $139.00 for a 4.3" 4D Systems GLCD when the real full sized item is available for pennies on the dollar as NOS today. It is only the market that has placed any value on the junk we buy today and when a new market jumps up there will be a NEW Gold Rush... The Gold Rushing from our pockets.
Then too there are the things like the Raspberry Pi. There were a lot of people I should think that now regret poking fun at that device... Not because it has any merit but because of the Money Potential involved...
It will be for me more what I cam do with a more versatile device. The Pi unfortunately and it's educational potential will always get second billing...
While I realize that my learning time isn't entirely wasted... Its a mighty limited intro into a complex language and little of what I learn is truly portable or really useful when applied to any of the "Bigger and newer" processors and their hardware/language sets. Witness the Basic Stamps... GREAT for recreation But hardly a package that EVER became popular because of the Electronics Learning end... Same here with Arduino.
I routinely run into people who would rather use an 18 pin IC to replace 2 transistors... Mainly because the package doesn't appear to be as difficult to use as the two parts... Never mind that it might have 6 other inputs that must be dealt with... It seems to be the learning or at least this is my experience in answering questions in General Electronics that comes so hard. Given a schematic diagram and the reasons why the method is easier... 70% of them will opt for an IC rather than do simple things like learn Ohm's Law.... Code engineers are a set apart from Electronics engineers.
Well Another Day in Paradise... Is upon us.
So many points you raised. Some I agree with, some I certainly don't agree with. My opinion of the Arduino movement is that is has brought more new people into this wonderful interface of hardware and software creation ability, and is approachable by almost anyone of any means and abilities, no matter what background they start from. It's not that the arduino platform has the best IDE, or ueses the best tool chain, or that it uses the best processor or hardware, but rather that it uses the simplest possible of those items that still allow one to learn the basics of both programming and circuit design and constuction. I have yet to see a better product to date that does that as well and includes the best support forum I have come across. And all open source hardware and software to boot. They scored a touchdown in my book, but then again I don't think they even had a clue when they first started to develop their project of what it was to become. The original goals of the project were not even close to what the outcome was to become.
I'm sorry if the Arduino platform has not been successful for you to meet your personal goals for why you obtained one, but I'm sure you have gained knowledge and experiences that you may not yet realize, if for nothing else then to help further define and refine what you like and don't like in a micro-controller development platform.