Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop LED blinking on claim() #10

Open
weisjohn opened this issue Mar 7, 2015 · 1 comment
Open

stop LED blinking on claim() #10

weisjohn opened this issue Mar 7, 2015 · 1 comment

Comments

@weisjohn
Copy link
Owner

weisjohn commented Mar 7, 2015

The controller blinks the LED around the xbox button continually, which is actually quite annoying. We should make the light go solid when we claim() and blink again when we release() #9

I found a reference from an Arduino project: https://dilisilib.wordpress.com/hacking/xbox-360-rf-module-arduino/. An excerpt incase of rot:

int led_cmd[10] =  {0,0,1,0,0,0,0,1,0,0}; //Activates/initialises the LEDs, leaving the center LED lit.
int anim_cmd[10] = {0,0,1,0,0,0,0,1,0,1}; //Makes the startup animation on the ring of light.

void sendData(int cmd_do[]) {
  pinMode(data_pin, OUTPUT);
  digitalWrite(data_pin, LOW);    //start sending data.
  int prev = 1;
  for(int i = 0; i < 10; i++){

    while (prev == digitalRead(clock_pin)){} //detects change in clock
    prev = digitalRead(clock_pin);
      // should be after downward edge of clock, so send bit of data now
    digitalWrite(data_pin, cmd_do[i]);

    while (prev == digitalRead(clock_pin)){} //detects upward edge of clock
    prev = digitalRead(clock_pin);
  }
  digitalWrite(data_pin, HIGH);
  pinMode(data_pin, INPUT);
}
@weisjohn weisjohn changed the title stop the blinking once it has been claimed stop LED blinking on claim() Mar 7, 2015
@weisjohn
Copy link
Owner Author

weisjohn commented Mar 7, 2015

http://www.redcl0ud.com/xbcd.html also exists and may be more promising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant