Arduino Night: Difference between revisions

From Unallocated Space
Jump to navigation Jump to search
(8 intermediate revisions by 3 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;
 
  void setup(){
      for(byte a = 0; a < totalPins; a++){
        pinMode(pins[a], OUTPUT);
      }
  }


  void writeData(byte data, byte numberOfBits, byte startBit){
==Classes==
      for(byte a = startBit; a < numberOfBits; a++){
 
        if((data >> a) & 0x01){
1) Here we go again <span style="color:red">-done</span>
            digitalWrite(pins[a], HIGH);
 
        }else{
2) Digital Write
            digitalWrite(pins[a], LOW);
 
        }
3) Digital Read
      }
 
  }
4) Analog Write
 
5) Analog Read
 
6) Serial
 
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)