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
    
  
  
    
  | % If you have two sets of data for different x values and want to plot them in error-bar format in matlab you can use this. | |
| clear all | |
| close all | |
| clc | |
| % Make up some data to plot | |
| x = [.12 .24 .36 .48 .6]; % x-values | |
| y1ConeAng1 = [33 31 27 25 30]; %y1(1) values for x1 point | 
  
    
      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
    
  
  
    
  | clear all | |
| close all | |
| clc | |
| %% data inputs | |
| D1 = load ('points100disorder.txt'); % simplest way, don't need to worry about length | |
| %D = dlmread ('points100disorder.txt', ',', 'A1..B100'); % reads data from dat file and A1 is the cell id like excel | |
| D2 = load ('points200disorder.txt'); | |
| D3 = load ('points320disorder.txt'); | 
  
    
      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
    
  
  
    
  | classdef monkey | |
| % monkey -- class definition file | |
| properties | |
| x % monkey x location | |
| y % monkey y location | |
| high % logical state for monkey | |
| end % end properties | |
| methods | 
  
    
      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
    
  
  
    
  | """ | |
| Some serial port utilities for Windows and PySerial | |
| Eli Bendersky (eliben@gmail.com) | |
| License: this code is in the public domain | |
| """ | |
| import re, itertools | |
| import _winreg as winreg | |
  
    
      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
    
  
  
    
  | """ | |
| This script reads and writes serial data to MSP430. | |
| MSP430 is programmed to send data if a command is sent. | |
| Commands Request | |
| 0x36 Vcc | |
| 0x35 Temperature | |
| 0x32 Voltage at P1.3 | |
| Once command is sent MSP430 sends two bytes, these are then decoded. | 
  
    
      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
    
  
  
    
  | /****************************************************************************** | |
| * MSP430 ADC10 Example for the G2231 | |
| * | |
| * Description: This code provides an example for using the 10 bit ADC in the | |
| * MSP430G2231. The code requires either a terminal program or | |
| * the application provided on the blog mentioned below. | |
| * depending on which ascii character is sent to the device, | |
| * either VCC, the temperature sensor, or an external pin will | |
| * be measured once and the results sent to the computer. | |
| * | 
  
    
      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
    
  
  
    
  | #include <msp430g2553.h> | |
| void configureClocks(); | |
| volatile unsigned int i; | |
| void main(void) | |
| { | |
| WDTCTL = WDTPW + WDTHOLD; | |
| configureClocks(); | 
  
    
      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
    
  
  
    
  | #include <msp430g2553.h> | |
| void configureClocks(); // Setting clock speeds | |
| volatile unsigned int i; // Volatile to prevent optimization | |
| void main(void) | |
| { | |
| WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer | |
| configureClocks(); | 
  
    
      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
    
  
  
    
  | #include <msp430g2553.h> | |
| volatile unsigned int i = 0; | |
| void main(void) | |
| { | |
| WDTCTL = WDTPW + WDTHOLD; | |
| P1DIR |= BIT0; // P1.0 output, BIT0 is define as (0x0001) in the header file | |
| P1OUT &= ~BIT0; // P1.0 output LOW, LED Off | |
| P1DIR |= BIT6; // P1.6 output | 
  
    
      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
    
  
  
    
  | #include <msp430g2553.h> | |
| volatile unsigned int i = 0; // Volatile to prevent optimization. This keeps count of cycles between LED toggles | |
| void main(void) | |
| { | |
| WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer. This line of code is needed at the beginning of most MSP430 projects. | |
| // This line of code turns off the watchdog timer, which can reset the device after a certain period of time. | |
| // If you've a lot of initializations, this line prevents the system from falling into infinite loops. | |
| P1DIR |= 00000001; // P1DIR is a register that configures the direction (DIR) of a port pin as an output or an input. | |
| // To set a specific pin as output or input, we write a '1' or '0' on the appropriate bit of the register. |