-----Original Message----- From: Lypps, Andrew Sent: Monday, July 30, 2007 4:44 PM To: 'Bindiya Mansharamani' Subject: RE: [Lejos-discussion] Ultrasonic Sensor
Bindiya, I'm not sure your declaring your new sensor correctly. Check the API but all of the code examples I've seen from the book and the VP website go something like this: static UltrasonicSensor us = new UltrasonicSensor(SensorPort.S3); etc... Try changing sonic to us and S2 to S3. Good luck, Andrew ________________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bindiya Mansharamani Sent: Monday, July 30, 2007 12:36 PM To: [email protected] Subject: [Lejos-discussion] Ultrasonic Sensor I modified the program but it still doesnt work: import lejos.nxt.*; import lejos.subsumption.*; import lejos.navigation.*; public class FollowWall { static final int TOTALTIME = 60000; public static void main(String[] args) throws Exception { UltrasonicSensor sonic = new UltrasonicSensor(SensorPort.S2); int startTime = (int)System.currentTimeMillis(); int totalTime = 0; while(totalTime < TOTALTIME) { if(sonic.getDistance() > 20) Motor.B.rotate(10,true); else { Motor.B.forward(); Motor.C.forward(); } totalTime = (int)System.currentTimeMillis() - startTime; } } } Please help Thanks [EMAIL PROTECTED] wrote: Send Lejos-discussion mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/lejos-discussion or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Lejos-discussion digest..." Today's Topics: 1. Re: New alpha0.3.0 release (Justin Shaw) ---------------------------------------------------------------------- Message: 1 Date: Fri, 20 Jul 2007 23:05:28 -0400 From: Justin Shaw Subject: Re: [Lejos-discussion] New alpha0.3.0 release To: "Lypps, Andrew" Cc: [email protected] Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset="iso-8859-1" Thats great news, thanks for making the fruits of your effort available to the rest of us! Justin Lypps, Andrew wrote: > > That's great! > > A couple of questions: > Do you have any suggestions on how to resolve the bluetooth trouble > for mac and linux? > I just got alpha0.2.0 working real good on my mac! How would I go > about porting 0.3.0 over from say, the linux build? > The same way I did 0.2.0 perhaps? > Also, is there extended functionality in the new API that isn't in > 0.2.0? Else I could just continue to use 0.2.0. > Or, is it possible to just hack the new API functions (classes etc.) > into my working 0.2.0 build? > > Thanks for all of your time. > > Regards, > Andrew > > > -----Original Message----- > From: [EMAIL PROTECTED] on behalf of > Lawrie Griffiths > Sent: Mon 7/16/2007 06:35 > To: [email protected] > Subject: [Lejos-discussion] New alpha0.3.0 release > > Hi, > > The new firmware release of leJOS NXJ is finally out - see the > announcements, download page and API docs on the web site. > > Apologies for the long delay - it proved difficult to make the flash > version work reliably on all NXTs. > > The release is a true firmware release - you flash new firmware with > nxjflash. (All the commands now start "nxj" and you now set the > environment variable NXJ_HOME). > > This release is a lot different to the last one, so read the > README.html file. > > There is now a simple menu system, a file system that stores programs > and data in flash memory, and a new set of PC tools, including > nxjbrowse - a NXJ file explorer that works over USB and Bluetooth. > > Let us know if the release works for you, either on this list, or in > the forums on the web site. There are still issues with Windows Vista, > due to the use of libusb. Some people might have trouble with > Bluetooth as the open source library, Bluecove, is used, and this only > supports the Microsoft, not the Widcomm Bluetooth stack. > > This release should work well from Eclipse and other IDEs. All the > samples have ant build files that have been tested free-standing, and > from Eclipse. If you don't want to use the ant build files, you can > set up two external tools in Eclipse: nxjc to compile your program, > and nxj to link, upload and run it. > > This release is currently for Windows and Linux. We hope to have a MAC > OS X release out soon. > > NXT to NXT Bluetooth comms did not make it into the release. We hope > to have a new release out in a few weeks with improvement > communications - including NXT to NXT comms, and a PC-based comms > proxy for communication with the outside world. > > Lawrie > > > > > > > > > =================================================================================== > CONFIDENTIALITY NOTICE: This email and any files transmitted with it > are confidential and intended solely for the use of the individual or > entity to which they are addressed. If you are not the intended > recipient, you may not review, copy or distribute this message. If you > have received this email in error, please notify the sender > immediately and delete the original message. Neither the sender nor > the company for which he or she works accepts any liability for any > damage caused by any virus transmitted by this email. > =================================================================================== > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ------------------------------------------------------------------------ > > _______________________________________________ > Lejos-discussion mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/lejos-discussion > -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ ------------------------------ _______________________________________________ Lejos-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lejos-discussion End of Lejos-discussion Digest, Vol 14, Issue 14 ************************************************ ________________________________________ Pinpoint customers who are looking for what you sell. =================================================================================== CONFIDENTIALITY NOTICE: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this email in error, please notify the sender immediately and delete the original message. Neither the sender nor the company for which he or she works accepts any liability for any damage caused by any virus transmitted by this email. =================================================================================== ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Lejos-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lejos-discussion
