Comments (4)
Hello,
You can access internal firmware using io maps, there is an io map for button here:
https://git.ni.fr.eu.org/nxt-firmware.git/tree/src/c_button.iom
You can try to make sense of the corresponding module to see whether it would be possible to simulate a button press:
https://git.ni.fr.eu.org/nxt-firmware.git/tree/src/c_button.c
Here is the function used to read the button state for the menus:
https://git.ni.fr.eu.org/nxt-firmware.git/tree/src/c_ui.c#n389
So setting PRESSED_STATE in the corresponding State array should work.
Have fun!
Nicolas.
from nxt-python.
Tell me if you need help to make a prototype.
from nxt-python.
Hi Nicolas,
many thanks for your pointers! Very helpful, I got it to work!
First I had to figure out the module id for the buttons:
modules = b.find_modules()
for x in modules:
print(x)
resulting in (amongs others): ('Button.mod', 262145, 0, 36)
I was then continuously reading the iomap data with
data = b.read_io_map(0x40001, 0, 36)[1]
for y in range(0,len(data)):
print(data[y], end = ' ')
print()
and observing what happens when I press the buttons on the NXT brick. After I knew this, I could issue this group of commands
b.write_io_map(0x40001, 34, bytearray([0x80]))
b.write_io_map(0x40001, 34, bytearray([0x80]))
b.write_io_map(0x40001, 34, bytearray([0x0]))
b.write_io_map(0x40001, 34, bytearray([0x0]))
which "simulates" a press of the left-button (complete with "!Click"-sound). The right-button would have offset 33, return-button offset 32, and exit-button offset 35.
For some reason I have to issue the write_io_map commands twice - otherwise my NXT brick would occasionally "miss" a simulated keystroke...
Anyway, now I just have to extend nxt-screen.py to include a button-interface to get a completely remote-controlled NXT brick.
Best regards,
Andreas
from nxt-python.
Nice, waiting for your pull request :)
from nxt-python.
Related Issues (20)
- Assistance required during installation process HOT 26
- Problems with installing nxt-python HOT 4
- Error when connecting with bluetooth HOT 24
- raise BlockedException("Blocked!") HOT 1
- Error struct.error: unpack requires a buffer of 2 bytes (EV3) HOT 4
- No backend available HOT 1
- Help with motorconotrl HOT 1
- Not able to download MotorControl22.nxc to NXT HOT 2
- nxt_filer needs to be updated (minor fixes) HOT 3
- usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1 HOT 7
- Add contribution guide HOT 2
- Hitechnic SuperPro Board HOT 7
- How save in the lego HOT 1
- Nxt_test hangs at connecting using bluetooth HOT 1
- MotCont: Differential drive robot HOT 4
- Bluetooth Error HOT 12
- EV3 doesn´t connect to NXT (via USB) HOT 5
- [FEATURE REQUEST]: Screen Drawing HOT 1
- [NOOB QUESTION]: How to get rotation angle of motor? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nxt-python.