-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Description
Hi,
I am working on a project with the UDOO board. The board has Ubuntu loaded on it as the main OS. It also has a Arduino DUE attached with it.
I wanted to confirm if we can use the Arduino commands in the C++ language if I have, "#include Arduino.h" in the code?? This is what I mean by using Arduino commands
/* Program to read data from the encoders.
This file is to read data and calculate velocity. encoder.cpp
*/
#include <iostream.h>
#include <Arduino.h>
void setup(){
pinMode(encoder0PinA, INPUT);
digitalWrite(encoder0PinA, HIGH); // turn on pullup resistor
pinMode(encoder0PinB, INPUT);
}
void main(){
if (digitalRead(encoder0PinA) == digitalRead(encoder0PinB)) {
encoder0Pos++;
} else {
encoder0Pos--;
}
Serial.println (encoder0Pos, DEC);
}
// End of Program
Can I run a C++ code using the arduino header file on the GNU compiler of Linux?
Metadata
Metadata
Assignees
Labels
No labels