Αποστολέας Θέμα: Ειδος γλωσσας?  (Αναγνώστηκε 531 φορές)

ChrisS

  • Νέος
  • *
  • Μηνύματα: 7
Ειδος γλωσσας?
« στις: 05 Μάι 2014, 04:50:19 μμ »
Ως εφηβος ασχοληθηκα λιγο με την πλατφορμα ανοιχτου υλισμικου και λογισμικου Arduino!
Αλλα παντα ειχα την απορια σε τι γλωσσα προγραμματιζεται ???
Ειχα διαβασει οτι η γλωσσα ειναι συνδιασμος C++ και Java αλλα υπαρχει καμια συγκεκριμενη ονομασια ?

Παραδειγμα κωδικα :

Κώδικας: [Επιλογή]
char INBYTE;
int  LED = 13;

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
}

void loop() {
  Serial.println("Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF:");
  while (!Serial.available());   // stay here so long as COM port is empty   
  INBYTE = Serial.read();        // read next available byte
  if( INBYTE == '0' ) digitalWrite(LED, LOW);  // if it's a 0 (zero) tun LED off
  if( INBYTE == '1' ) digitalWrite(LED, HIGH); // if it's a 1 (one) turn LED on
  delay(50);
}

P.Tsiotakis

  • Ομάδα Νέου Λυκείου
  • *
  • Μηνύματα: 3079
  • Dracarys
    • Panagiotis Tsiotakis
Απ: Ειδος γλωσσας?
« Απάντηση #1 στις: 05 Μάι 2014, 09:46:29 μμ »
http://en.wikipedia.org/wiki/Arduino

Arduino programs are written in C or C++.   

ChrisS

  • Νέος
  • *
  • Μηνύματα: 7
Απ: Ειδος γλωσσας?
« Απάντηση #2 στις: 06 Μάι 2014, 12:35:09 πμ »
Βασικα πιο κατω λεει οτι η γλωσσα λεγεται Wiring και οτι μετα το Arduino IDE (Intergrated Developing Enviroment) την κανει compile σε C / C++


Παράθεση
Arduino programs are written in C or C++. The Arduino IDE comes with a software library called "Wiring" from the original Wiring project, which makes many common input/output operations much easier. Users only need define two functions to make a runnable cyclic executive program:

setup(): a function run once at the start of a program that can initialize settings
loop(): a function called repeatedly until the board powers off
A typical first program for a microcontroller simply blinks an LED on and off. In the Arduino environment, the user might write a program like this:[16]



The integrated pin 13 LED
#define LED_PIN 13
 
void setup () {
  pinMode (LED_PIN, OUTPUT); // Enable pin 13 for digital output
}
 
void loop () {
  digitalWrite (LED_PIN, HIGH); // Turn on the LED
  delay (1000); // Wait one second (1000 milliseconds)
  digitalWrite (LED_PIN, LOW); // Turn off the LED
  delay (1000); // Wait one second
}
It is a feature of most Arduino boards that they have an LED and load resistor connected between pin 13 and ground; a convenient feature for many simple tests.[16] The previous code would not be seen by a standard C++ compiler as a valid program, so when the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written to a temporary file with an extra include header at the top and a very simple main() function at the bottom, to make it a valid C++ program.