-
Notifications
You must be signed in to change notification settings - Fork 62
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
T-deck trackball not working? #71
Comments
Also I cannot get the SD card to work. |
You forgot to set GPIO10 high. T-Deck/examples/GPSShield/GPSShield.ino Line 87 in 49c28ae
|
Oh. Sorry forgot to include that in the code. Updated. |
Is there a way to fix the SD card problem? |
What happened to the SD card? I thought you had no problem. |
Oh. Sorry. I had added that in a later comment. import machine
import os
import sdcard
sdspi=machine.SoftSPI(-1, sck=machine.Pin(40), mosi=machine.Pin(41), miso=machine.Pin(38, machine.Pin.IN))
sd = sdcard.SDCard(sdspi, machine.Pin(39))
os.mount(sd, '/sd')
print('SD card mounted.') But it randomly returns one of "OSError: no response from SD card", "OSError: timeout waiting for v2 card", or "OSError: [Errno 19] ENODEV" error. |
The SPI bus is shared by the screen and LoRa. You need to set the SPI CS of the screen and LoRa to HIGH, then perform SD initialization, and set GPIO10 to HIGH. Like this example Line 196 in 057ad44
|
Like this? import machine
from machine import Pin, SoftSPI
import sdcard
import os
pwr = Pin(10)
pwr.on()
sdCS = Pin(39)
screenCS = Pin(12)
loraCS = Pin(9)
screenCS.on()
sdCS.on()
loraCS.on()
MISO = Pin(38, Pin.IN, Pin.PULL_UP)
sdspi=machine.SoftSPI(-1, sck=machine.Pin(40), mosi=machine.Pin(41), miso=MISO)
sd = sdcard.SDCard(sdspi, sdCS)
os.mount(sd, '/sd') |
Yes, you try it. |
I tried it but It still doesn't work. |
Maybe you can try the Arduino code first to test whether the SD card is available. I am not familiar with Micropython. |
I am trying to read from the trackball in micropython, but the down direction seems to not work.
I am using this code:
Any ideas?
Also it would be great if you uploaded micropython examples for everything.
The text was updated successfully, but these errors were encountered: