-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff8b99c
commit 72ac054
Showing
1 changed file
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
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); | ||
|