Saturday, September 30, 2017

07 September '17-Day 4- Top down programming, logical and conditional statements


Beginning of class was spent working on Lab 4 which included wiring up the arduino board with a RGB LED and multiple switches.  The lecture in class went over the overall development for our algorithms and beginning every program with a top-down design.  Essentially we must look at the big picture and break down each step in the problem into steps for translating into language statements.  We also covered conditional expressions.  The conditional expressions include relational operators that can be used to compare two expressions.  A snap shot of a list of these operators is included below:

(these operators are used to compare expressions)
(examples using logical operators)
After the break we worked on more examples of condition statements as well as if/ else statements.  This allows us to execute a set of statements if a certain condition is true and if not then to continue on with a different statement.  Below are examples worked in class:

(writing out flowchart examples in the notes)



(hooking up a RGB LED to change colors for every time the button is pushed)










No comments:

Post a Comment