Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

help me Output my Input

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
7 postsPage 1 of 1
7 postsPage 1 of 1

help me Output my Input

Post by chully00 » Thu Apr 05, 2007 4:51 am

Post by chully00
Thu Apr 05, 2007 4:51 am

So the Robonova is great, really great. I've had mine for a few weeks now and I have been having a blast! I've been doing stuff that people on these forums have already done, like adding a gyro and of course making new poses and movements. I want to give the RN some more sensors, and make the most of them.
So anything I plug into the 8 AD ports I can get a value of 0-255 returned with the AD() function in RoboBASIC... but How do I tell what the value is?? I can't just "PRINT value" or something because there is no screen! (:twisted: yet... )
I noticed that according to my manual, a previous version of the ROBONOVA controller board had a SOUND function that would output 255 different freqencies, perfect for interfacing with the 255 different values that the AD function would get as input from the analog sensors. It would be a quick fix, and slightly better than using the position of a servo to indicate the value of my sensor reading... I spent a few hours scratching my head as to why SOUND didn't do anything for me! (Only MUSIC works out of such functions) I wonder if there is any way of getting this functionality on the MR-3024 board on my ROBONOVA?
I need to get some indication about what values my sensors are giving before I can really get any further in making my RN interact with the environment. Maybe I should invest in a bluesmirf, but since this kind of communication is only strictly essential during testing, maybe just a serial cable would work. Any suggestions to use the ERX and ETX with just a cable? and maybe one of these?
How do you find out stuff like sensor values?
So the Robonova is great, really great. I've had mine for a few weeks now and I have been having a blast! I've been doing stuff that people on these forums have already done, like adding a gyro and of course making new poses and movements. I want to give the RN some more sensors, and make the most of them.
So anything I plug into the 8 AD ports I can get a value of 0-255 returned with the AD() function in RoboBASIC... but How do I tell what the value is?? I can't just "PRINT value" or something because there is no screen! (:twisted: yet... )
I noticed that according to my manual, a previous version of the ROBONOVA controller board had a SOUND function that would output 255 different freqencies, perfect for interfacing with the 255 different values that the AD function would get as input from the analog sensors. It would be a quick fix, and slightly better than using the position of a servo to indicate the value of my sensor reading... I spent a few hours scratching my head as to why SOUND didn't do anything for me! (Only MUSIC works out of such functions) I wonder if there is any way of getting this functionality on the MR-3024 board on my ROBONOVA?
I need to get some indication about what values my sensors are giving before I can really get any further in making my RN interact with the environment. Maybe I should invest in a bluesmirf, but since this kind of communication is only strictly essential during testing, maybe just a serial cable would work. Any suggestions to use the ERX and ETX with just a cable? and maybe one of these?
How do you find out stuff like sensor values?
chully00
Robot Builder
Robot Builder
User avatar
Posts: 7
Joined: Tue Apr 03, 2007 6:39 am

Post by Humanoido » Thu Apr 05, 2007 6:32 am

Post by Humanoido
Thu Apr 05, 2007 6:32 am

That's the right idea. Without the LCD, sound can be used to return values. For example, it you wanted to read the battery voltage number, using the cable indicated in the manual, a select number of beeps can return the voltage range. By dimensioning a variable, a series of if-then statements can ferret out a value or range, then let you know the results with sound beeps. This is the method I'm using until a 4800 baud LCD is interfaced. Another method is to report the values and send the results over bluetooth to a pc.

humanoido
That's the right idea. Without the LCD, sound can be used to return values. For example, it you wanted to read the battery voltage number, using the cable indicated in the manual, a select number of beeps can return the voltage range. By dimensioning a variable, a series of if-then statements can ferret out a value or range, then let you know the results with sound beeps. This is the method I'm using until a 4800 baud LCD is interfaced. Another method is to report the values and send the results over bluetooth to a pc.

humanoido
Humanoido
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 574
Joined: Tue Dec 05, 2006 1:00 am
Location: Deep in the Heart of Asia

Post by Pev » Thu Apr 05, 2007 7:56 am

Post by Pev
Thu Apr 05, 2007 7:56 am

The LCD port is a 4800, 8,1,none serial interface at TTL levels. I have used this to connect to a PC running a terminal emulator via a TTL to RS232 level converter (probably preaching to converted but don't connect the LCD port directly to a PC serial port, voltages are all wrong and damage is highly likely). I can then use the LCD functions to "print" values to the Terminal session.

One word of warning, a lot of programs like hyperterm will convert your 0-255 value to a character. If you use something like RealTerm you get the choice of how it is displayed and can see if in HEX values for example rather than ASCII.

Now that works for programming and testing, when in motion so to speak I use the ETX/ERX ports with a Bluesmirf to send commands to the RN-1 and get data back.

Hope this helps

Pev
The LCD port is a 4800, 8,1,none serial interface at TTL levels. I have used this to connect to a PC running a terminal emulator via a TTL to RS232 level converter (probably preaching to converted but don't connect the LCD port directly to a PC serial port, voltages are all wrong and damage is highly likely). I can then use the LCD functions to "print" values to the Terminal session.

One word of warning, a lot of programs like hyperterm will convert your 0-255 value to a character. If you use something like RealTerm you get the choice of how it is displayed and can see if in HEX values for example rather than ASCII.

Now that works for programming and testing, when in motion so to speak I use the ETX/ERX ports with a Bluesmirf to send commands to the RN-1 and get data back.

Hope this helps

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by i-Bot » Thu Apr 05, 2007 11:03 am

Post by i-Bot
Thu Apr 05, 2007 11:03 am

I borrowed some of DirtyRoboto's Theramin code to do the variable to sound part.
I borrowed some of DirtyRoboto's Theramin code to do the variable to sound part.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by beermat » Fri Apr 06, 2007 11:24 pm

Post by beermat
Fri Apr 06, 2007 11:24 pm

Because I added tri-color eyes, I originally used that to output numbers - blue flashes to count the number of hundreds, green for tens, red for single digits.

Now, though, since I've added the Quadravox sound module, my RN just speaks the number out loud :)
Because I added tri-color eyes, I originally used that to output numbers - blue flashes to count the number of hundreds, green for tens, red for single digits.

Now, though, since I've added the Quadravox sound module, my RN just speaks the number out loud :)
beermat
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 137
Joined: Sun Jul 23, 2006 1:00 am

Thank you!

Post by chully00 » Fri Apr 27, 2007 7:53 pm

Post by chully00
Fri Apr 27, 2007 7:53 pm

:D
Thanks for all tha help guys!

I used the RoboTheramin code, and it was a lot of fun to play with, but I decided to go ahead and get a RS232-TTL level converter anyway. I used the Acroname Serial Interface Connector connected to ETX and ERX on the robonova's back, and connected to a keyspan usb-serial converter (connected to my teh computer)
:arrow: Keyspan and serial-ttl convertor
:arrow: Robonova wired up
I wrote a program to output 3-digit values, which is pretty silly but I figure I ought to save some other n00b like me the trouble of writing it, so here it is:
Code: Select all
'serialControl.bas - output 3-digit values to PC terminal

DIM A AS BYTE
DIM foo AS BYTE, x AS BYTE, y AS BYTE
DIM input AS BYTE, output AS BYTE
DIM H AS BYTE, T AS BYTE, O AS BYTE

PTP SETON             
PTP ALLON            

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0      
DIR G6B,1,1,1,1,1,1      
DIR G6C,0,0,0,0,0,0      
DIR G6D,0,1,1,0,1,0      

'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0

SPEED 5

'== motor power on  =============================
MOTOR G24   
TEMPO 230
MUSIC "C[E]B"
GOSUB standard_pose

'================================================
MAIN:       
      
   output = AD(5) 'The sensor we are reading here is on AD port 5

   GOSUB serialOutput
   
   GOTO MAIN

serialOutput:
   foo = output
   H = 0
   T = 0
   O = 0
   hundreds:
      IF foo > 99 THEN 
         H = H + 1
         foo = foo - 100
         GOTO hundreds
      ENDIF
   tens:
      IF foo > 9 THEN
         T = T + 1
         foo = foo - 10
         GOTO tens
      ENDIF
   ones:
      O = foo
      
   'Convert to ASCII
   H = H + 48
   T = T + 48
   O = O + 48
   foo = " "
      
   ETX 9600, H
   ETX 9600, T
   ETX 9600, O
   ETX 9600, foo
   
   RETURN
   
'send the output variable register to the PC (unused)
sendToComp:
   ETX 9600, output
   RETURN

'recieve input from the PC Terminal (blocking) (unused)
recvFromComp:
   ERX 9600, input, recvFromComp
   RETURN

'================================================
standard_pose:
   MOVE G6A,100,  76, 145,  93, 100, 100
   MOVE G6D,100,  76, 145,  93, 100, 100 
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   WAIT
   RETURN
:D
Thanks for all tha help guys!

I used the RoboTheramin code, and it was a lot of fun to play with, but I decided to go ahead and get a RS232-TTL level converter anyway. I used the Acroname Serial Interface Connector connected to ETX and ERX on the robonova's back, and connected to a keyspan usb-serial converter (connected to my teh computer)
:arrow: Keyspan and serial-ttl convertor
:arrow: Robonova wired up
I wrote a program to output 3-digit values, which is pretty silly but I figure I ought to save some other n00b like me the trouble of writing it, so here it is:
Code: Select all
'serialControl.bas - output 3-digit values to PC terminal

DIM A AS BYTE
DIM foo AS BYTE, x AS BYTE, y AS BYTE
DIM input AS BYTE, output AS BYTE
DIM H AS BYTE, T AS BYTE, O AS BYTE

PTP SETON             
PTP ALLON            

'== motor diretion setting ======================
DIR G6A,1,0,0,1,0,0      
DIR G6B,1,1,1,1,1,1      
DIR G6C,0,0,0,0,0,0      
DIR G6D,0,1,1,0,1,0      

'== motor start position read ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0

SPEED 5

'== motor power on  =============================
MOTOR G24   
TEMPO 230
MUSIC "C[E]B"
GOSUB standard_pose

'================================================
MAIN:       
      
   output = AD(5) 'The sensor we are reading here is on AD port 5

   GOSUB serialOutput
   
   GOTO MAIN

serialOutput:
   foo = output
   H = 0
   T = 0
   O = 0
   hundreds:
      IF foo > 99 THEN 
         H = H + 1
         foo = foo - 100
         GOTO hundreds
      ENDIF
   tens:
      IF foo > 9 THEN
         T = T + 1
         foo = foo - 10
         GOTO tens
      ENDIF
   ones:
      O = foo
      
   'Convert to ASCII
   H = H + 48
   T = T + 48
   O = O + 48
   foo = " "
      
   ETX 9600, H
   ETX 9600, T
   ETX 9600, O
   ETX 9600, foo
   
   RETURN
   
'send the output variable register to the PC (unused)
sendToComp:
   ETX 9600, output
   RETURN

'recieve input from the PC Terminal (blocking) (unused)
recvFromComp:
   ERX 9600, input, recvFromComp
   RETURN

'================================================
standard_pose:
   MOVE G6A,100,  76, 145,  93, 100, 100
   MOVE G6D,100,  76, 145,  93, 100, 100 
   MOVE G6B,100,  30,  80, 100, 100, 100
   MOVE G6C,100,  30,  80, 100, 100, 100
   WAIT
   RETURN
chully00
Robot Builder
Robot Builder
User avatar
Posts: 7
Joined: Tue Apr 03, 2007 6:39 am

Post by brindy » Sun May 06, 2007 8:17 pm

Post by brindy
Sun May 06, 2007 8:17 pm

beermat wrote:Because I added tri-color eyes, I originally used that to output numbers - blue flashes to count the number of hundreds, green for tens, red for single digits.

Now, though, since I've added the Quadravox sound module, my RN just speaks the number out loud :)


any chance you could post a link to the module, please? i tried to look at the quadravox website, but it's not very good :roll:

i'm going to be adding sonar, and i have no idea how to get feedback just now. :oops:

tia 8)
beermat wrote:Because I added tri-color eyes, I originally used that to output numbers - blue flashes to count the number of hundreds, green for tens, red for single digits.

Now, though, since I've added the Quadravox sound module, my RN just speaks the number out loud :)


any chance you could post a link to the module, please? i tried to look at the quadravox website, but it's not very good :roll:

i'm going to be adding sonar, and i have no idea how to get feedback just now. :oops:

tia 8)
brindy
Robot Builder
Robot Builder
Posts: 14
Joined: Mon Apr 02, 2007 4:40 pm
Location: Glasgow, UK


7 postsPage 1 of 1
7 postsPage 1 of 1