sthompson86

08-28-2010, 06:27 PM

Hello all, I am in a microcontroller class this semester, and the class is using the Parallax Basic Stamp as the device we learn on. This is the teachers first semester to teach using the Basic Stamp as the device, therefore, we are the pilot class. The teacher let us know he would be asking us to do some extra things with the PBASIC that may not be in the book. ( which is what I am getting to)

Nonetheless, the teacher asked us to do what I thought would be a simple math programming function.

The requested project is the teachers custom version of the Debug Formatters and Control Characters on page 25 of the "What is a Microcontroller" book Ver. 2.2

The whole class was able to successfully complete the books project of adding 7 * 11 , and the teachers requested " 7 * 11 + 24 -1 " he just wanted to run a series of math functions in one line of code. EASY.

HARD - Then he asked all of us to compile something like this. He wanted us to take

7 * 11 + 24 - 1 which equals 100 and then in the next code line take the answer of the "7 * 11 + 24 - 1" (100) and add that 100 to another line of code with more mathematic functions.

something like this:

7 * 11 + 24 - 1 = Var1

Var1 + 2 - 1

= 101

He just wanted us to compile 2 problems into Vs stringing the whole thing out into 1 line of code.

THe class spent 2 whole class periods trying to figure this out, and the teacher didnt even know how to do it. Nonetheless, he said he didnt know, but he would give the points to anybody who could figure it out.

I know I am the only one who is going to the extent and ask the Parallax forums, so I hope to be the one to get things figured out for the class.

I am asking for help, I am no programmer and this is my first taste of it.

Any help is appreciated - Thanks

Nonetheless, the teacher asked us to do what I thought would be a simple math programming function.

The requested project is the teachers custom version of the Debug Formatters and Control Characters on page 25 of the "What is a Microcontroller" book Ver. 2.2

The whole class was able to successfully complete the books project of adding 7 * 11 , and the teachers requested " 7 * 11 + 24 -1 " he just wanted to run a series of math functions in one line of code. EASY.

HARD - Then he asked all of us to compile something like this. He wanted us to take

7 * 11 + 24 - 1 which equals 100 and then in the next code line take the answer of the "7 * 11 + 24 - 1" (100) and add that 100 to another line of code with more mathematic functions.

something like this:

7 * 11 + 24 - 1 = Var1

Var1 + 2 - 1

= 101

He just wanted us to compile 2 problems into Vs stringing the whole thing out into 1 line of code.

THe class spent 2 whole class periods trying to figure this out, and the teacher didnt even know how to do it. Nonetheless, he said he didnt know, but he would give the points to anybody who could figure it out.

I know I am the only one who is going to the extent and ask the Parallax forums, so I hope to be the one to get things figured out for the class.

I am asking for help, I am no programmer and this is my first taste of it.

Any help is appreciated - Thanks