What do you mean by "lack of support for sub routines in C"? C has all sorts of support for subroutines. In C you declare a subroutine as a function with a "void" result type like:
void foobar(void) {
// do stuff
}
If you want parameters, you put those instead of the 2nd "void" like:
void foobar( int stuff, int *moreStuff) {
// do stuff
}
PING DAR should be easy to do. There's a version of FemtoBasic for the Activity Board and a translation of Roaming With PING into FemtoBasic. PING DAR isn't as complicated a program.
It seems like a difficult task bec of the lack of support for sub routines in C. Any thoughts?
Yeah, what Mike said...
Attached is a version of the spin kickstarter example project (link: http://learn.parallax.com/KickStart/28015) code in C as a SimpleIDE project. It is in SimpleIDE's ZIP format. I used spin2cpp to quickly convert the project from spin to C. Should be a fairly simple task to add-in Ping))) Dar functions...
Oh, and functions don't always return a void type...
int myFunction(int someInt) {
// do something really cool, here!
}
Is a perfectly suitable function that takes an integer and returns an integer!
Comments
void foobar(void) {
// do stuff
}
If you want parameters, you put those instead of the 2nd "void" like:
void foobar( int stuff, int *moreStuff) {
// do stuff
}
PING DAR should be easy to do. There's a version of FemtoBasic for the Activity Board and a translation of Roaming With PING into FemtoBasic. PING DAR isn't as complicated a program.
Here's the link for the Activity Board FemtoBasic.
Yeah, what Mike said...
Attached is a version of the spin kickstarter example project (link: http://learn.parallax.com/KickStart/28015) code in C as a SimpleIDE project. It is in SimpleIDE's ZIP format. I used spin2cpp to quickly convert the project from spin to C. Should be a fairly simple task to add-in Ping))) Dar functions...
Oh, and functions don't always return a void type...
Is a perfectly suitable function that takes an integer and returns an integer!
dgately