summaryrefslogtreecommitdiff
path: root/bsd-core/via_mm.c
AgeCommit message (Collapse)Author
2007-07-20BSD: Replace symlink building with symlinks in git.Eric Anholt
href='#n13'>13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48


// GMSL Configuration
const int MAX16951_EN = 6;

void set_EN(int onoff)
{
    digitalWrite(MAX16951_EN, onoff);

    if (onoff)
      Serial.print("Pin High\n");
    else
      Serial.print("Pin Low\n");
}

void setup() {
  pinMode(MAX16951_EN, OUTPUT);
  set_EN(LOW);

  Serial.begin(115200);
  Serial.print("\n");
  //Serial.setDebugOutput(true);
}

void loop() {
  int i;
  // configure power-on state before delay
 
  set_EN(LOW);

  // blink a bit
  for (i=0; i<10; i++) {
    digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(50);                       // wait for 50 ms
    digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
    delay(50);                       // wait for 50 ms
  }
    
  // configure final state after delay
  set_EN(HIGH); 

  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)

  while(1) {
    delay(1000);
    // Serial.print("Spinning\n");
  }
}