Pages: [1]   Go Down
Author Topic: What is Arduino exactly?  (Read 779 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 20
Posts: 2101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've seen C++ and C mixed together while coding in Arduino.

So is Arduino the IDE? and the language is C part C++

meanwhile check out my crappy weather station  I've just finished writing, i use a BOSH BMP085 sensor with Wiznet to deliver a basic weather station

http://110.175.97.110:1234

(South Australia, Adelaide, Clearview)
http://www.weatherzone.com.au/sa/adelaide/clearview   (official info to compare to)

So what am i coding in? hybrid C/C++ ?
« Last Edit: April 04, 2012, 12:57:24 am by cjdelphi » Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

C++ is a superset of C. The language of Arduino is C++.
Logged

West Des Moines, Iowa USA
Offline Offline
Sr. Member
****
Karma: 2
Posts: 428
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Craig - It's working. Consider adding a location; weather info for 'noplace in particular' isn't very useful. smiley

Unless you cause it to behave differently, the Arduino IDE compiles your code as C++.
Logged

There's always a better way!

Offline Offline
Edison Member
*
Karma: 20
Posts: 2101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lol, the location is my bedroom, um South Australia (Adelaide) smiley-razz - but...

the question was, and you've answered it, C++ - i'll be honest i hate C++ as long as i get away with C (on the whole) looking code i'll be happy, my first program i wrote
was written in C when i was 8 (22 years ago) and i like C, not C++ i used Object Pascal (for objects) maybe i need to write a Pascal compiler lol..

anyway so it's C++ huh - thanks.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Somewhere in South Australia, I am guessing. Based on the 240V and the IP address.

Oh, and the temperature. It's 29C in Adelaide apparently, whereas it's a bit cooler where I am.

Look for the house with the bedroom light off.

(edit) ninja'd!  But I worked it out before he posted.
Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lol, the bedroom light is a Cree 3 watt LED underdriven via a PNP 2222a transistor smiley  and a 5v linear regulated supply smiley-razz

Yeah well, it is 3:39pm light will be off smiley  lol - so can i say i code in C++ even though it looks identical to C? lol
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can say that if you want to.

A reasonably simple program in C++ will look the same as one in C. Well, put it this way, with some restrictions the same code will compile in C and C++.

But if you are doing this, for example:

Code:
Serial.println ("hello");

Then you are using C++.

Serial is an instance of the class HardwareSerial, and you are calling a member function of that instance.

And classes are a C++ thing. smiley 

Sorry to disappoint you.
Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

awwww, yeah you're right Serial. <<object smiley-sad

grrrrr lol
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6362
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can i say i code in C++ even though it looks identical to C?
I am capable of writing C programs in several languages.  C, C++, Java, Perl, ...  :-)
Logged

Offline Offline
Edison Member
*
Karma: 20
Posts: 2101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've grown up on a diet of Pascal and Object Pascal, C++ (objects look scary) but C i can handle, PHP i can handle, C++ and objects that look like object::fsdfsdf scare me smiley-razz

Begin
  Writeln('Please no C++');
End.
lol

or

<?php
  echo "Please no C++ \n";
?>


or

printf(" Really no!");

lol, it's not that i don't like C++ just that i've been spoilt with objectpascal

EG.

Code:
Var
 S: String;
 Key,B: Byte;
 N: Integer;
begin
 S:=Edit1.Text;
 Key:=55;
 For N:=1 to Length(S) do
  Begin
    B:=Ord(S[N]);
    B:=B Xor Key;
    S[N]:=Chr(B);
  End;
  LoadLibrary
 Edit1.Text:=S;


for (n=0; n<StrLen; n++)
{
  int b = 0;
  int key = 55;
 
 //  B:=Ord(S[N]);  //ord is the Decicmal of Ascci value, eg, A = 65; so abcde becomes 65 66 67...
  //  B:=B Xor Key;  // xor 55 with 65 (A or whatever)
   // S[N]:=Chr(B);  //replace string back with the XOR'ed version
 
  
}

how would you do that in C/C++ ?  

The 'English' descriptions  Begin End; XOR, it's all pretty much explained to you as you code, where as with C++ you have to remember so very specific info - i'm spoilt lol
« Last Edit: April 04, 2012, 02:19:05 am by cjdelphi » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know exactly what you mean. I spent 10+ years programming in Turbo Pascal. C seemed really strange at first. But, you adjust ...
Logged

Smithfield, Rhode Island
Offline Offline
God Member
*****
Karma: 2
Posts: 843
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can handle C as you say, then what makes C++ so scary? Its not as bad as you think. I don't think its bad at all.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 434
Posts: 23596
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Almost seems like BASIC with semicolons & { }s at this point.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: