How FORTRAN on punch cards? Had to do that for a freshman year college class.
Error messages back were even less useful than the IDE error messages!
CrossRoads:
How FORTRAN on punch cards? Had to do that for a freshman year college class.
Error messages back were even less useful than the IDE error messages!
I too took a night class at a local Jr. College in FORTRAN programming in the 70s. Typed source on a IBM 029 keypunch, wait in line to submit job to comppile and run on a IBM 1130, wait for job to be entered and return to find out results, usually didn't even compile because of some missing directive card or something. That was a painful class just because of the lack of a real-time inactive interface we now take for granted. ![]()
Very painful. You would wait a day for your batch of cards to be processed, and the printout returned. Then you get a simple compiler error. It might be a week before you even got a clean compile.
It might be a week before you even got a clean compile.
I have that problem now ![]()
Rob
I too took a night class at a local Jr. College in FORTRAN programming in the 70s. Typed source on a IBM 029 keypunch, wait in line to submit job to comppile and run on a IBM 1130, wait for job to be entered and return to find out results, usually didn't even compile because of some missing directive card or something. That was a painful class just because of the lack of a real-time inactive interface we now take for granted.
But then ... all of a sudden the 029 keypunches ran out of the ink ribbon. Sh...ucks, lets type more carefully and better start reading the punched holes ![]()
Or worse you arrived to the room with the keypunches and all of the 029 were being used and there was just an abandoned 026 (no printing) with cobwebs free to use. Better to go away for a coffee or something and be back later or after midnight. ![]()
Fortunately for me, at the UofM there were also quite a few teletype terminals around campus which you could also use a run sessions interactively (well, sort of).
I'm talking 1969-71. XD
Sorry for interrupting the conversation, but relating back to the original topic, to learn C/C++ should you use a book that has the Arduino structure or use a Standard Programming language book?
I would find a C++ book whose style appeals to you. Or one of the many tutorial web sites. Some Arduino stuff is specific to the device, but you could say the same about anything (eg. 3D graphics). The basics are the same.
Just be warned that some C++ tutorials assume you have a keyboard and screen, and start you off with reading from the keyboard and displaying to the screen. However you can adapt those easily enough to use the Serial class to send to the serial monitor.
I don't know, I just jumped in, tried some of the tutorials, and had at it.
The Arduino structure is just C++ with libraries taking care of some things for you, like Reading the Serial port or writing to it,
and writing the I/O pins high & low.
All programs will follow this format:
// declare variables with initial values, or assign names to the pins to use.
// all use same format: variable_type (byte, int, etc.), variable_name, pin number or initial value:
byte onBoardLED = 13; // the LED pin, turns on when high
byte incomingByte = 0; // 8 bit variable
// set up stuff that will run once
void setup() {
// set the pins as an input or output
pinMode (onBoardLED, OUTPUT);
// and give it an initial state
digitalWrite (onBoardLED, LOW); // low is off
// set up for serial comm's with the PC
Serial.begin(9600); // using 9600 baud
} // end of setup
// now ready to do something over & over
void loop(){
// see if a character came in from the Serial Monitor
if (Serial.available() > 0){
// yes , read it
incomingByte = Serial.read();
// and send it back to the monitor
Serial.print (incomingByte);
// turn on the LED while we're at it
digitalWrite (onBoardLED, HIGH);
// for some small time
delay (10); // 10 milliseconds
// and back off
digitalWrite (onBoardLED, LOW);
} // done checking if a character came in
} // done with loop, go back to the top of loop
and use CTRL-T or Tools:Autoformat to make it nice & readable
Come up with a project, ask questions, read the Reference page.
@bibre - I tried Snobol but didn't like it much. It was, however, one of the languages that influenced my design of PL/C (written up in the March '84 edition of DDJ), which strongly resembled BNF with conditional output and symbol handling capabilities. My long-after impression is that Snobol lacked the flexibility I wanted/expected.
I don't know, I just jumped in, tried some of the tutorials, and had at it.
Same with me. I had written some very elementary programs in QuickC a long time ago, but I had forgotten most of the language. The Arduino Reference and Tutorials are excellent and helped me very much for a very quick start.
My long-after impression is that Snobol lacked the flexibility I wanted/expected.
I agree. And also it was difficult, at least for me, to understand programs written by others. Snobol is the strangest prog language I've ever seen.
I wrote a small DBMS program in PL/I but never got to use PL/C. So, you designed it, congratulations! 8)
APL is pretty odd also. I knew a couple guys in high school who did some.
Here's an example found at Wikipedia:
The following function "life", written in Dyalog APL, takes a boolean matrix and calculates the new generation according to Conway's Game of Life. It demonstrates the power of APL to implement a complex algorithm in very little code, but it is also very hard to follow unless one has an advanced knowledge of APL.
life?{?1 ??.?3 4=+/,¯1 0 1?.?¯1 0 1?.???}
... but it is also very hard to follow ...
Which kind-of explains why it didn't take off.
Wow, I had completly forgotten APL, "A Programming Language" or something like that??? Never understood it.
And there was also Lisp... Never understood it either. ![]()
Ah yes! An APL account with IP Sharp was a much prized thing, even if it was pretty much a write only language.
A vector average came in at about 9 keystrokes, IIRC.
And there was also Lisp... Never understood it either.
Power language I've read, but very hard on the (((((( and )))))) keys, requiring keyboard replacement every six months.
Lefty
Just look at some of the simple example sketches in the IDE, if you have any idea at all, you'll soon pick it up. I'd done nothing with C derivative languages until Arduino
Sorry for interrupting the conversation
Eh? What's that sonny? Sorry; the mind wanders a bit... ![]()
to learn C/C++ should you use a book that has the Arduino structure or use a Standard Programming language book?
This is actually a hard question, especially if you goal is to program Arduinos. C++ is a "big" language not usually associated with small microcontrollers, and the typical C++ book is likely to start with a "hello world" program that opens a window and "paints" some text. Then it will go on to describe out to use a whole bunch of standard desktop Windows classes/libraries that aren't relevant in a microcontroller. Arduino uses a very small subset of the features of C++ (at least, in ways visible to users), and has libraries that are mostly very different from those you would use on a desktop.
A C text would probably be slightly better, because it doesn't easily support the complexity of the desktop environment (that's sort of why there is C++!)
An "embedded C" text would likely include a lot about things that the Arduino environment specifically hides from you.
I would suggest perhaps one of the very early "C language" books (K&R, even. From the days before windows!) in combination with an Arduino text. Either read the C language stuff and find out how it is usually applied to Arduino, or read the Arduino text and use the C book to get more information on the language constructs that are used...
Kelley and Pohl's A Book On C is quite readable, and contains notes on C++, but even that sometimes assumes quite large amounts of RAM
Went to BN and found C++ for dummies and considered buying it until i heard westfw on the subject. I have seen books on the internet that are specifically on the subject of programming Arduino's. The book is Beginning Arduino Programming, offered from BN.com. Does it show much promise or should i pick another.