In this lesson we are going to send message on computer screen using play me. For this we are using Serial communication. It is used for communication between the Controller board and a computer or other devices. In our life we are doing communication it is like speaking with friends, email sending, by phone call. Mostly we are exchanging information. Our playme is having one controller which controls all operations like robot movement, led ON/OFF. If our playme wants to communicate with other devices like computer, Bluetooth then it should follow serial communication which standard for every micro controller system.

  • In this information or data is send to other device one by one with defined speed of communication.
  • In this program we are going to send message from playme to computer after specific time period.

 

  • Goto mblock software and open it. Goto edit menu and select Arduino mode.

  • Playme Robot Program is a Header file for Robot programming.
  • It makes programming simple. By using this we can access all blocks easily and smoothly.
  • If we are not using this then it may give us errors in program.
  • So put this at start of program.

  • Here we are using loop. Loop is area which will be repeated for certain times depending upon its type.
  • If we write anything inside loop then it will be repeated along with loop.
  • Forever loop means program will run continuously.
  • For example: if we write a program to run motor in forward direction with forever loop then it will run until we remove power applied to it.
  • Select block Send to Computer and drag it in programming window.

  • Put it in forever loop. Here we are writing Hello for message printing.
  • You can write any message instead of Hello.

  • Connect wait statement after send to computer.
  • For next message printing we are taking 1 second time.
  • Wait value can be changed.

 

  • Now save program.

  • Give name to program.

  • Select COM port
  • Click on Upload Arduino option
  • After uploading is done you will get this message

  • Click on close option.
  • Again go to Serial port and select COM port

 

  • And see output of your program

  • You can see this response which is not hello message.
  • To get proper message select Char mode for both send encode mode, recv encode mode.

 

  • And see hello message on your screen. It will be displayed on screen after every one second.