Skip to content

Instantly share code, notes, and snippets.

View ssaluk's full-sized avatar

Sergiy Salyuk ssaluk

View GitHub Profile
@ssaluk
ssaluk / led_smile.ino
Created May 13, 2017 15:46
Arduino 1388ASR
/*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
@ssaluk
ssaluk / LayoutConstraint.swift
Last active August 29, 2015 14:02
Swift operators overloading and autolayout
//
// LayoutConstraint.swift
// SwiftControls
//
import UIKit
struct LayoutAttribute
{
var view:UIView?