Week #11: (11/13-17) PING Sensor & Math Operations with the BS2

Post Reply
rjagodowski
Posts: 2371
Joined: Fri Sep 04, 2015 6:59 pm

Week #11: (11/13-17) PING Sensor & Math Operations with the BS2

Post by rjagodowski »

This week we will discuss The PING Sensor posted in Week #9 and then begin discussing the mathematical operations available on the BS2.

We will be using the Basic Stamp Syntax and Reference Manual and review some of the various mathematical operations which exist. The manual can be downloaded from Parallax's website or directly from the CSET Forums here.

We'll begin with the Unary operators on page 105 and then the Binary operators on page 109.

We will look at some common functions and see how the BS2 can implement these functions using integer math only. Functions to look at include: Add, Subtract, Multiply, Division, Modulus, Trig Functions and Digital Logic Functions (AND, OR, etc.).

Additional Support LInks:

Binary, Inverse and Complement Codes for representation of Magnitude Only (Positive numbers only) & Sign-Magnitude (Positive & Negative Numbers) . Seeing as there is no minus sign (-) in binary, just 0's & 1's, the convention for sign/magnitude encoding is that the MSB will be a "0" for positive numbers and a "1" for negative numbers. By far, the 2's Complement system is the most common and preferred method of representing both positive and negative numbers in binary. The BS2 uses this system as well.
Post Reply

Return to “EET-260 Lecture”