NXT45 Posted November 7, 2014 Posted November 7, 2014 (edited) Hi I just bought a lego IR link sensor and am in the proccess of making a program for it. I will be using 1 nxt in my technic creation. I want to use 2 touch sensors to move one PF motor forwards or backwards on a channel selected by the left/right nxt buttons. The problem is that I wanted to use the left/right buttons on the brick to change the PF channels but limit it so that it can only change to 3 channels. (I hope that makes sense.) I am using the NXT software to program these robots. Here are the programs. http://www.brickshel...ry.cgi?f=549419 (Folder is not yet public so when it is click on the folder problems.) Edited November 7, 2014 by NXT45 Quote
Lipko Posted November 7, 2014 Posted November 7, 2014 (edited) You need something like this? if(right_button_pressed AND channel_index < 3) then channel_index = channel_index +1 end if ? anyhoo, deeplink the programs please. Edited November 7, 2014 by Lipko Quote
NXT45 Posted November 7, 2014 Author Posted November 7, 2014 You need something like this? if(right_button_pressed AND channel_index < 3) then channel_index = channel_index +1 end if ? anyhoo, deeplink the programs please. I want to use the nxt software to prgram this robot. Thanks anyways. Quote
mescalinum Posted November 7, 2014 Posted November 7, 2014 Do you take into consideration using leJOS? There is a driver for IRLink around, and the code would be quite straightforward. Quote
NXT45 Posted November 7, 2014 Author Posted November 7, 2014 Do you take into consideration using leJOS? There is a driver for IRLink around, and the code would be quite straightforward. I know a lot about programming in the nxt software so I think I'll stick with that. Thanks anyways! Quote
Lipko Posted November 7, 2014 Posted November 7, 2014 It's not clear for me what you are asking. Do you ask about the API, about sematics of Mindstorm programming, about the algorithm to use to limit the channel id, or about using the hardware, or how the implement the whole feature from zero. Quote
NXT45 Posted November 7, 2014 Author Posted November 7, 2014 It's not clear for me what you are asking. Do you ask about the API, about sematics of Mindstorm programming, about the algorithm to use to limit the channel id, or about using the hardware, or how the implement the whole feature from zero. What I want is a limit to how many times the variable is changed when you press the left/right NXT buttons. Quote
Lipko Posted November 7, 2014 Posted November 7, 2014 What I want is a limit to how many times the variable is changed when you press the left/right NXT buttons. Oh I see now, some dataflow like language. I'm pretty sure there's a conditional block or something, google for "conditional" + the programming tool/language's name Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.