This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Warning: the next three program lines (the definition of three array) may seem complicated, but are a brilliant system (found on the net) to simplify management of array. For this reason definitely worth it to spend a few minutes to analyze them, interpret comments ,and understand how they works. * | |
The "pins" array defines the correlation between the matrix legs (represented by | |
the index used to scroll the table) and arduino's pins: the pins 2 to 17 (considering how pins 14,15, 16 and 17 the analog pins A0, A1, A2, and A3). | |
The first item in the table ("99") is present only in order to occupy a place and allow the index to start from the value of 1. | |
Reading the table shows that the leg 1 is connected to pin 5, leg 2 to pin 4, leg 3 at pin 3... | |
*/ | |
int pins[17]= { 99, 5, 4, 3, 2, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6}; | |
/*The "cols" array defines the correlation between the columns (1 to 8) and the Arduino pins. | |
* Considering the previous "pins" array you can deduct that the first column is connected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LayoutConstraint.swift | |
// SwiftControls | |
// | |
import UIKit | |
struct LayoutAttribute | |
{ | |
var view:UIView? |