Hardware Reference
In-Depth Information
SERIAL LIBRARY FUNCTIONS
WIRE LIBRARY FUNCTIONS
SPI LIBRARY FUNCTIONS
read()
readBytes()
readBytesUntil()
find()
findUntil()
parseInt()
parseFloat()
setTimeout()
write()
The arduPi template looks like this:
//Include arduPi library
#include "arduPi.h"
/*********************************************************
* IF YOUR ARDUINO CODE HAS OTHER FUNCTIONS APART FROM *
* setup() AND loop() YOU MUST DECLARE THEM HERE *
* *******************************************************/
/**************************
* YOUR ARDUINO CODE HERE *
* ************************/
int main (){
setup();
while(1){
loop();
}
return (0);
}
As you can see in the main() function, the setup() function is called once, and then the
loop() function is called continuously until the program is forced to finish.
Whether you're writing a new program or already have an Arduino program written
that uses the ported functions, you can use the template ( ardupi_template.cpp ) and
put your Arduino code where it says YOUR ARDUINO CODE HERE . Remember that the
program you are writing is a C++ program, so you can use all the C++ libraries. Here
are the available Arduino functions:
Search WWH ::




Custom Search