Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MicroWorlds Forum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Fwd: manipulating text files and serial port communication
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Wed, 24 Nov 2010 09:28:28 -0500

On Wed, 24 Nov 2010 06:02:22 -0500, Rotem Kimchi <rotemk2@xxxxxxxxxxxxxxxx> wrote:

Yes I built a robot and I want to communicate with him using ZigBee protocol through the serial port with logo commands. For now I am using a cable to burn a programs to the robot using Robotc program but I want to use logo Pro. At first I thought I could send logo's commands and then translate them using the robot uP, but I think that the command .send in logo cannot send chars only integers am I
correct?

No. You are sending characters. But you are sending them in ascii code

http://1.bp.blogspot.com/_inEdXKgdgj0/TG1oFopLTYI/AAAAAAAABNE/5KrCnphKrTU/s1600/ascii.gif

You should send the number in the DEC column if you want the transfer the character in the CHAR column.

Logo has commands that do the conversion:

show ascii "A
65

show char 65
A

This procedure asciifies a word:

to asciify :word
if empty? :word [stop]
show ascii first :word
asciify butfirst :word
end

asciify "|fd 100|
102
100
32
49
48
48

Notice that "fd 100" is a single word (what is called a "string" in other languages).
NOT a sentence with two words.

If so I'll send numbers that will represent the commands using the first bits to described the OPCODE (the command type: fd seth,bk..) or a value, and after that I’ll send the number that described the command or the value
itself.

If you wish.

As far as the robot it's not a problem to teach him new command words and make him do what i want him to do. I created the text file before I knew about the logo ability to use the serial port and I wanted to take a file that have a singal command and using a c code in order to translate him to a binary code and send him in the same way, through the serial port. You told me "I think using text files is easier... but maybe just because I've never used serial port communication" so i wanted to know how come? , but you probably didn't understood the all purpose of the application.

Correct, I didn't understand that you wanted to transfer the content of those text files to a robot.

Daniel
OpenWorld Learning



  • Previous by thread: Re: Fwd: manipulating text files and serial port communication
  • Next by thread: Re: Fwd: manipulating text files and serial port communication

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008