Absolutely love this! Do you think you could use analogue pins to control the circle pad? That would give you more functionality with movement for sun and moon. I plan on trying to do something similar using more traditional sketches and c++, I would love a follow up to this video in more of an "explains" style like some of your other videos!
@anthonywritescode11 ай бұрын
yep! the analog pads would be pretty easy to automate -- you'll need DACs (similar to what I did for my joycon automation here: github.com/asottile/nintendo-microcontrollers/tree/main/hw/joycon ) I also got the touchscreen working -- though that was after this video: github.com/asottile/nintendo-microcontrollers/tree/main/hw/3ds-touch
@jond769111 ай бұрын
@@anthonywritescode could I not use the pwm on the pro micro for the circle pad? Would simplify the circuit quite a bit and seems like that’s what the 3xtds does
@anthonywritescode11 ай бұрын
yeah you can make two crude DACs with PWM + resistor + capacitor which would work well enough for the circle pad (you don't need microsecond resolution like the touchscreen fortunately!)
@jond769111 ай бұрын
@@anthonywritescode well I have mixed results! The pwm sort of works for c stick control, but it's too noisy with the capacitors I have to be useable. I ordered two dacs in case I wanted to do the touch screen anyway so i'll have a go with that, but i'm not sure how to control both at once. I'm having a lot of trouble with my level shifters (74LVC245), of the 12 pins i'm using between the two, only 3 are giving me 1.8v. The rest are either 0 or fluctuating between 0.5 and 1.2v.
@anthonywritescode11 ай бұрын
I2C is a bus so you can hook them up to the same lines for sda / scl -- one of them gets a different address when you give it voltage on its A0 pin (I believe 0x62 and 0x63) not sure how it would work with 4 though :S
@SanixDarker Жыл бұрын
didn't knew you do hardware stuffs too ! Amazing btw !
@anthonywritescode Жыл бұрын
admittedly not much! this is my like ~3rd hardware project
@TooLazyToFail Жыл бұрын
What a fun project!
@ZacJW Жыл бұрын
Maybe I've misunderstood your explanation of the way the 3DS does its buttons, but why would you even need a level shifter at all? Couldn't you just use the data direction registers on the micro to switch between pulling the pins low and disconnecting (high impedance). If you were particularly worried about the micro putting out higher voltages during startup, couldn't you have just used diodes which a sufficiently low forward drop and save yourself the hassle of finding the right kind of level shifter?
@anthonywritescode Жыл бұрын
I need high for unpressed and low for pressed -- so I need some way to get from 5V to 1.8V to denote unpressed -- or at least that's my understanding
@ZacJW Жыл бұрын
@@anthonywritescode I don't think you do need high for unpressed. Before you soldered leads to those test points the 3DS was able to tell that the buttons were unpressed when they were. That didn't change when you soldered the wires on. All the buttons do when pressed is short those traces to ground and the 3DS processor detects that drop in voltage as the button being pressed. To trick the 3DS into the thinking the button has been pressed you just short it to ground. To release it you stop shorting it to ground. Note that that doesn't mean to start pushing voltage into it, just to stop pulling. This configuration is known as open drain and you can interface with it from the arduino without any extra components. The trick is to exploit what pinMode actually does to the microcontroller at an electrical level. pinMode OUTPUT means assert the line level requested in the last digitalWrite you did. That means if you digitalWrite HIGH and are in OUTPUT mode then it's as if the pin is connected to 5V (since the arduino is TTL 5V) through negligable resistance. This strongly pulls the connected circuit to 5V. If you digitalWrite LOW in OUTPUT mode it strongly pulls the circuit to 0V. pinMode INPUT does the same thing (yes you can digitalWrite while in INPUT) with one difference, instead of pulling with very low resistance, it pulls with fairly high resistance (20 KOhms when HIGH, 100 MOhms when LOW, for most arduinos I think) resulting in the effect being much weaker. For your situation you'll keep the pins LOW but switch between OUTPUT and INPUT modes to press and release the button respectively. The only issue that may arise is that this will only work if the arduino and 3DS have a common ground potential, which according to your project readme, is the case so no problem there (just be careful to avoid plugging the 3DS in to charge while the arduino is plugged in). The digital pins page on arduino's docs has more info if I've done a bad job explaining it.
@anthonywritescode Жыл бұрын
ah that's a neat idea -- feels a bit like taking advantage of implementation details though I also probably can't use the idea though because I need to keep the 3ds plugged in (some of the events I'm trying to automate are exceedingly rare -- requiring hundreds of hours plugged in)
@anthonywritescode Жыл бұрын
coming back to this -- this worked great for my other project! (wired up a reset button to the Wii) -- switching between INPUT and OUTPUT works exactly perfect!
@Jakub1989YTb Жыл бұрын
I love it!
@Blokilicious Жыл бұрын
What is ur text editor? And why do you use it vs neovim/vscode?
@anthonywritescode Жыл бұрын
check out the faq playlist -- there's a video where I go over that question precisely