BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Thu Apr 26, 2018 12:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: New Command List - Suggestions?
PostPosted: Sun Jul 25, 2010 5:09 am 
Offline
Master

Joined: Mon Jul 17, 2000 6:00 pm
Posts: 155
We are thinking about some new commands, heres what we have so far. I need some recommendations / comments.

1. SDcard - Read / Write SD card using Fat32.
2. GLCD - Standard graphic lcd.
3. PS2 - Consolidate the PS2 controller code into a command.
4. PCKey - Read a PC keyboard.
5. PCMouse - Read a pc mouse.
6. CLCD - Color LCD command works with Nokia Displays.
7. ???

_________________
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Wed Jul 28, 2010 10:52 pm 
Offline
Master

Joined: Mon Jul 17, 2000 6:00 pm
Posts: 155
Still looking for some command ideas.....

_________________
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Wed Jul 28, 2010 11:33 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
I thought I posted some trivial ones.

* DTMF decode (and generate)

* CW decode (and generate)

* encoder support routines

* PID control function

* Odometry calculations

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Wed Jul 28, 2010 11:36 pm 
Offline
Master

Joined: Mon Aug 18, 2008 1:26 am
Posts: 799
Location: CA bay Area
GPS strings parsing.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Thu Jul 29, 2010 12:40 am 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Yes, GPS string parsing would be nice.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Fri Aug 20, 2010 2:49 am 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 5:06 pm
Posts: 120
Location: Wisconsin USA
I'm all for #3 and #4.
Inputting commands are once of my biggest issues.
I'm limited to 24 commands right now. Which is fantastic, the old version of my terminal program only allowed 12.

But being able to bind a command to a PC keyboard key would be fantastic.
Especially since i can occasionally find some old wireless PS/2 port keyboards still.

Also i'm considering switching to an IR ps2 controller, and having it as basic commands. Or rather basic Variables.
Since the sticks on the ps2 controller are variable, have it 0-100 (center to full tilt)

enableps2

if [ps2(y) < -10 and ps2(x) > 10] then ;10 points as a dead zone
go * -ps2(y) ;have the ps2 command as a variable, since for me -y is up, multiplying a negative ps2(y), would invert it.
turn * ps2(x)
endif

It would be -y 10 points, and +x axis 10 points, so if +X is greater than 10, it leaves the deadzone.

-y axis would work from 0 to -100
+y axis from 0 to 100
same for -x/+x as well as Ry and Rx


move forward and right (not a real command) but you get the idea.
for me forward and right would be a few serout strings and would be a bit more complicated, but i think you get the general idea. Something simple, and easy like that should work

button examples
ps2(LT) left trigger
ps2(RS) right stick
ps2(LLT) lower left trigger
ps2(sb) square button
ps2(cb) circle button
ps2(pu) pov up "the directional pad"
ps2(st) start
ps2(se) select

buttons would = 0 or 1, sticks -100,0,100
People could add controls to bots very easily this way :D

PS, for my xbox 360 controller using the custom XBCD drivers, the left stick up is -y, and down is +y, that's why forward and right would be -y and +X

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Fri Aug 20, 2010 4:00 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
There are already several sample programs that are used for wired/wireless PS2 controllers(eg dualshock). Just do a search on the forums or search www.lynxmotion.net forums.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Fri Aug 20, 2010 5:22 pm 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 5:06 pm
Posts: 120
Location: Wisconsin USA
Oh i could definitely bind the inputs to ps2(button) style commands myself, would take me an hour or so.
But i thought this thread was also to offer shortcuts to make it easier.
should still do the keyboard thing though. 108 keys... cant beat that.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Sat Aug 21, 2010 6:40 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
You are right, I was just pointing out that code was readily available if you were waiting on a command for it. :)

I do plan on doing a PS2 control system using the syncronous serial port at some point and that may be made in to a special hardware command, HPS2 maybe.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Sat Aug 21, 2010 7:01 pm 
Offline
Master
User avatar

Joined: Tue Jul 07, 2009 5:06 pm
Posts: 120
Location: Wisconsin USA
That would definitely be neat.
Another addition would be simple codes for the directions as an alternative to the whole xy thing.
ps2(1,100) "up at 100%"
ps2(2,050) "up and right at 50%"
ps2(3,75) "right at 75%" (without the extra 0)
ps2(8,025) "up and left at 25%"

ps2(9,100) "right stick up at 100%"
ps2(10,100) "right stick up and right 100%

Each direction would be a number, left stick 1-8, right stick 9-16. buttons from 17-28. POV/D-pad 29-36.
Sticks work from 0-100, buttons are 0-1 on or off.

if (ps2(2) >= 10) then
leftmotor = 1* ps2(2)
rightmotor = 0.75 * ps2(2)
end if

Essentially going forward and right. at the same time, left motor going faster than right.
With this setup, even a beginner can use their ps2 controller.


Like i said, my current problem with my bot is i'm limited to 24 commands, which seems like a lot, but what i forgot to mention, is i can only send 1 at a time, so i can send up, or right, but not up and right.

I'm thinking of getting the ps2 controller adapter, and wiring it up to a wired ps2 controller, equipped with an Xbee, battery, and atom nano 28.
So the controller will be an all in one.

PS, we really should be allowed to edit our post when ever we want.

_________________
Image
Basic Micro Blog
Universal Robot Controller


Top
 Profile  
 
 Post subject: Re: New Command List - Suggestions?
PostPosted: Sun Aug 22, 2010 2:59 am 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
Nathan,
I like the idea of a hardware based PS2 implementation, except for the fact I believe you would have to use up the hardware serial port, so the majority of the time I would not use it as the bit bang versions work fine. That is not to say, it would not be nice to have a set of APIS that make the code easier for people to read... For example there is a nice C++(Arduino) class for doing PS2 code. For me it sure is a lot easier to read:
Code:
    ps2x.read_gamepad();          //read controller and set large motor to spin at 'vibrate' speed
    if (ps2x.ButtonPressed(PSB_START)) {// OK lets try "0" button for Start.
            if (g_fHexOn) {


Than it is to read the equivalent basic code:
Code:
  low PS2SEL
  shiftout PS2CMD,PS2CLK,FASTLSBPRE,[$1\8,$42\8]   
  shiftin PS2DAT,PS2CLK,FASTLSBPOST,[DualShock(0)\8, DualShock(1)\8, DualShock(2)\8, DualShock(3)\8, |
     DualShock(4)\8, DualShock(5)\8, DualShock(6)\8]
  high PS2SEL
  pause 10   
 
  ; Switch bot on/off
  IF (DualShock(1).bit3 = 0) and LastButton(0).bit3 THEN   ;Start Button test
   IF(HexOn) THEN
...
  ;Store previous state
  LastButton(0) = DualShock(1)
  LastButton(1) = DualShock(2)


The library takes care of remembering which buttons were pressed the previous call to readGamePad, so you can simply ask for ButtonPressed to handle it on the time it was pressed, likewise for ButtonReleased...

[Fallentine]You can not edit your post? I thought usually there was an edit button toward the bottom right of the post that allowed you to edit your post.

Kurt


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO