User Tools

Site Tools


notes:c4eng:fall2023:projects:ptb1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
notes:c4eng:fall2023:projects:ptb1 [2023/10/19 02:43] mwinter4notes:c4eng:fall2023:projects:ptb1 [2023/10/19 02:54] (current) mwinter4
Line 32: Line 32:
 =====LOGIC===== =====LOGIC=====
  
-Synopsis: +**Synopsis:**
 To achieve our desired outcome with only one if statement, we'll need to implement bit shifting and a for loop.  To achieve our desired outcome with only one if statement, we'll need to implement bit shifting and a for loop. 
-It would also be helpful, first, to create an array. +It would also be helpful, first, to create an array if our pins are not connected sequentially 
  
 =====ARRAYS IN C===== =====ARRAYS IN C=====
  
 +To declare an array in C is similar to declaring any variable: we declare the data type (in arrays, the data type of all the elements), name the variable, and assign a value (or a matrix of values for arrays). 
 +
 +<code> 
 +int myArray[10] = {5,2,22,6,...}; 
 +</code>
 +
 +In our sample, 10 is the number of elements we have (not shown).
notes/c4eng/fall2023/projects/ptb1.1697683433.txt.gz · Last modified: 2023/10/19 02:43 by mwinter4