File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change 2323#define N64_PINB_LOW DDRB |= pincode
2424#define N64_PINB_QUERY (PINB & pincode)
2525
26- N64Controller::N64Controller () {
27- }
28-
29- N64Controller::N64Controller (int serialPin) {
26+ N64Controller::N64Controller (unsigned char serialPin) {
27+ if (serialPin > 13 )
28+ serialPin = 2 ;
3029 n64_PIN = serialPin;
3130}
32- void N64Controller::begin (int serialPin) {
33- n64_PIN = serialPin;
34- begin ();
35- }
31+
3632void N64Controller::begin () {
3733 // Communication with N64 controller controller on this pin
3834 // Don't remove these lines, we don't want to push +5V to the controller
Original file line number Diff line number Diff line change 4141
4242class N64Controller {
4343 public:
44- N64Controller ();
45- N64Controller (int serialPin); // first thing to call
46- void begin (int serialPin);
44+ N64Controller (unsigned char serialPin); // first thing to call
4745 void begin (); // second thing to call
4846 void update (); // then update always and get button info
4947 // consider to have a delay instead of
@@ -68,7 +66,7 @@ class N64Controller {
6866 void print_N64_status ();
6967 private:
7068 void set_up ();
71- int n64_PIN; // might also be set by constructor or begin()
69+ char n64_PIN; // might also be set by constructor or begin()
7270 char n64_pincode;
7371 bool n64_first_register; // PIN0-7: DDRD PIN8-13: DDRB
7472
You can’t perform that action at this time.
0 commit comments