Arduino Night: Difference between revisions

From Unallocated Space
Jump to navigation Jump to search
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Random Code==
== External code links ==
* Writing an arbitrary number of bits to pins
Various code snippets used during class - http://pastebin.com/u/uas_arduino
  byte pins[] = {2,3,4,5,6,7};
 
  byte totalPins = 6;
==Classes==
 
 
  void setup(){
1) Here we go again <span style="color:red">-done</span>
      for(byte a = 0; a < totalPins; a++){
 
        pinMode(pins[a], OUTPUT);
2) Digital Write
      }
 
  }
3) Digital Read
 
 
  void writeData(byte data, byte numberOfBits, byte startBit){
4) Analog Write
      for(byte a = startBit; a < numberOfBits; a++){
 
        if((data >> a) & 0x01){
5) Analog Read
            digitalWrite(pins[a], HIGH);
 
        }else{
6) Serial
            digitalWrite(pins[a], LOW);
 
        }
7) Interrupts
      }
 
  }
8) ShiftOut In
 
9) I2C
 
10) SPI
 
11)  
 
12)
 
13)

Revision as of 14:57, 18 June 2016

External code links

Various code snippets used during class - http://pastebin.com/u/uas_arduino

Classes

1) Here we go again -done

2) Digital Write

3) Digital Read

4) Analog Write

5) Analog Read

6) Serial

7) Interrupts

8) ShiftOut In

9) I2C

10) SPI

11)

12)

13)