Question

I'm a student on a hogeschool in the Netherlands. We're working with the LEGO Mindstorms NXT for a project.

However, I'm using my phone (minddroid and other applications) to drive the NXT, but I don't know how to simultaneously run a program.

For example, I drive it over a black line with the remote, and because the program is running, the sensor sees in the program that if it drives over a black line, it has to stop.

Was it helpful?

Solution 2

No I meant that I wanted to run a program simultaneously with the bluetooth remote. But I solved it, I connected the nxt with a mobile app, so I could only send direct commands. I solved it by connecting with the program, not the nxt robot.

Thanks anyway!

OTHER TIPS

Is your question how to get the NXT to both communicate on bluetooth and monitor the line at the same time? If so:

Then there are two general solutions:

Main Loop

In your main loop, first check for communications from the bluetooth system, and then check the sensor to see if the black line is detected. Then repeat.

Interrupt

In this solution, the main process would handle communications with the Android phone. The line sensor would be setup to cause a program interrupt when it detects the black line.

The interrupt service routine (ISR) would either set a flag to indicate that the robot should stop or would directly stop the robot.

Choosing which of the above solutions you choose is often dependent on the features of your operating system.

PS It could also be that I'm not understanding your question correctly. In that case, never mind...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top