# Mystery Gadget - Code name "LoMoR" - RSS feeds Bog Off

Here is a Mystery Gadget i made for you to ponder over until i get some Video Up and Running.

Edit:- Now Fully Blogged "LoMoR"

NB. If there are any Automatic RSS feeders listening into this Blog then  "Bog Off" ,this is a Top Secret LMR only scoop.

Any Idea what it is then feel free to guess............codenamed "LoMoR" Lets-Orientate-Map-Our-Robots

## Comment viewing options

Gareth,

Of course you can have an angle of 0 or 360 degrees, although convention, here at least, is that you use 0 to 359.999999 so not to use both at the same time.

PeteH

Solved my polar x,y Maths

Two things :-

1. Arduino (sin-cos) expects to see angles measured in radians (not Degrees  as i found out later ....Duhhh)
2. By adding 90° to the angle i managed to twist the display into correct orientation. (not Austrailian coords - more China coords as OddBot pointed out)
3. Is it possible to have an angle of 0° or 360° ?

Whenever I work with values that are supposed to "wrap around" like compass courses, I make liberal use of the "modulo" function in my code. It also works out for finding the "remainder" after a division. Remainder (or mod for short, very confusing) is often written in code as %.

That way, I can can freely add and subtract values without worry_ing about overshooting the max (or undershooting the min). Examples:

300 + 120 = 420 degrees
420 % 360 = 60 degrees (the remainder after dividing 420 / 360)
or
111 - 122 = -11 degrees
-11 % 360 = 349 degrees (the remainder after dividing -11 / 360)

And:
360 % 360 = 0 (which is automagically reinforcing the convention to use 0 instead of 360).

Too bad compass courses don't use values 0-255. That would be really easy to wrap around in an integer byte value. Either way: adding or subtracting.

Next Code update will include the % trick - thanks for the tip rik

As long term .... i would like to have a crack at 360° scanning systems. (Using Ir or laser)

Yes "bit" systems are the future and far more logical.

I've got to agree, those are nice LCD's! I'm anxious to see your code though :D

Have you looked into using a.. what is it called.. the 74LS164 I believe, Serial in Parallel out chip. That would open up ALOT of pins for you, but would also do a good bidding on changing the code. You would only need I believe 5 wires, 2 for power, and 3 for CLK, DATA and ... something else! There's a library for running the normal Non-graphical LCD's for the Arduino, using the 74LS164. It would take a bit of customization but would be worth it! Save you like 900 pins :D

Take a look here, for the post anyways:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243195750

Also if you're in the US, this Ebay vendor is AMAZING. 3 days delivery on the other side of the US, free shipping.. and they have badass deals. (I swear I'm not advertising.. haha I'm just very surprised with this dealer inparticular:D)

http://stores.shop.ebay.com/FCB-Electronics-Peltier-LED-LCD-USA__W0QQ_armrsZ1  They have some of the LCD's you're looking for, and also another thing I gotta point out, if you use breadboard alot, I HIGHLY HIGHLY suggest using the jumper wires they have. Seriously makes using a breadboard much better, much cleaner and easier to work with!

Basic system is so:-

1. Arduino - LCD walkthrough
2. GLCD based display
3. Data Sheet for KSO108B

My code_ing works this way (will post code when maths is reworked)

1. Servo scans with attached Ultrasonic sensor taking distance measurments
2. From this you have the angle of the servo with distance to object
3. Convert the Angle from Polar Coordinates to (cartesian coordinates)
4. ie x=cos(angle)*distance, y=sin(angle)*distance
5. then you can plot direct to the display x,y
6. Result is a visual map of your scanned area

Yes it does use a lot of pins and leaves you with only 5 i/o pins (arduino) - however my idea is to use Arduino Mega
The Pin into breadboard is a super idea - i was so excited with my idea that rapid prototyping took over and anything happens then.....

The LCD module gareth got is cheaper at Futurlec.com (19.90\$usd) i think, but longer shipping time since its an australian shop shipping from tawan or something like that.

I got a serial enabled graphic LCD from sparkfun for 34\$usd and hopeing to be able to combine it with the nintendo touch screen in a simple way.

"Purchase at FCB only if you will leave ALL 5 stars DSR.

By necessity, any none 5 stars DSR giver will be blocked from future buying."

Because the whole point of buyers feedback is for sellers to fudge them...

I know one thing for sure.

I'm ordering one of those graphical LCD's right away!

I spy something shiny! Could it be an arduino linked to a touchscreen?