Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaustindavid committed Jun 10, 2014
1 parent ff8b99c commit 72ac054
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion factory_reset/factory_reset.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
/*
* This will "factory reset" a wiiceiver chip by returning saved values
* to default, as present in a new / unflashed ATMega328P
*
* This is NOT MAGIC -- it doesn't really do anything you can't easily
* do in a working wiiceiver, but it might help troubleshooting in
* specific cases.
*
* To reset a wiiceiver the easy way:
* 1) start it and hold C; count to 10
* 2) hold down until the wheels stop, then all the way right for 5 secs
*
* This will re-calibrate the nunchuck stick, and set auto-cruise to 0
*
* If for whatever reason you want to do the hard way:
* 1) upload this to your wiiceiver
* 2) observe both red & green LEDs lot solid
* 3) upload the wiiceiver code
* 4) observe wiiceiver acting like a "new" device, with
* default settings for the joystick calibration and auto-cruise
*
* (CC BY-NC-SA 4.0) Austin David, [email protected]
* 10 June 2014
*/

#include <EEPROM.h>

#define RED_LED 8
#define GREEN_LED 6

// returns true if the value at the specified location is set correctly
boolean readValues(int address, byte desiredValue) {
boolean fixValue(int address, byte desiredValue) {
byte storedValue = EEPROM.read(address);
if (storedValue != desiredValue) {
EEPROM.write(address, desiredValue);
Expand Down

0 comments on commit 72ac054

Please sign in to comment.