×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    2

    I want control AVR (ATMega8) Robot with Nokia 3230 (Infrared Phone)

    I want control AVR (ATMega8) Robot with Nokia 3230 (Infrared Phone)

    http://www.uploadd.com/imageUpload/i...XCIHL2RYQ45BXV

    Introduction
    The ATMega8 Suit have Remote Control (ER-4) Already!
    The ER-4 send by RS-232 baudrate 1200 8N1(8 bit, No Parity ,1 Stop bit)

    Process Of Remote Control ER-4 (4 Chanel)
    Press botton A for up (send A ASCII 41)
    Press botton B for back (send B ASCII 42)
    Press botton C for left (send C ASCII 43)
    Press botton D for right (send D ASCII 44)

    And It use for Infrared Receiver 38 kHz

    This is a sourcecode with C
    but when you download into robot
    It will convert to .hex file

    #include <stdlib.h> // Standard Library
    #include <soft_serout.h> // For SLCD Module
    #include <sleep.h> // For Delay
    #include <serial.h> // For Recieve Data from Remote Control
    #include <sound.h> // For Generate Sound
    #include <motor.h> // For Control Motor

    unsigned char key,flag=0;

    void main()
    {
    sleep(1000); // Delay 1 Sec
    soft_serout_init(0,9600); // Initial Serial Comm 9600 8N1
    uart_set_baud(1200); // Set IR remote control Baudrate
    sound(2000,200); // Status Sound
    serout_byte(0,0xFE);serout_byte(0,0x01); // Clear Screen SLCD
    serout_byte(0,0xFE);serout_byte(0,0x80); // Show Text on First Line
    serout_text(0,"Press any IR Key");

    while(1) // Infinite Loop
    {
    key=uart_getkey(65000); // waiting and read key from remote control 33 mS
    if ((key=='a')||(key=='A')) // "A" key for Backward
    {
    backward(100);
    if (flag!=1) // Show "Backward" on SLCD first time only
    {
    serout_byte(0,0xFE);
    serout_byte(0,0xC0);
    serout_text(0,"Backward ");
    flag=1;
    }
    }
    else if ((key=='d')||(key=='D')) // "D" key for Forward
    {
    forward(100);
    if (flag!=2) // Show "Forward" on SLCD first time only
    {
    serout_byte(0,0xFE);
    serout_byte(0,0xC0);
    serout_text(0,"Forward ") ;
    flag=2;
    }
    }
    else if ((key=='c')||(key=='C')) // "C" key for Forward
    {
    s_left(100);
    if (flag!=3) // Show "Turn Left" on SLCD first time only
    {
    serout_byte(0,0xFE);
    serout_byte(0,0xC0);
    serout_text(0,"Turn Left ");
    flag=3;
    }
    }
    else if ((key=='b')||(key=='B')) // "D" key for Forward
    {
    s_right(100);
    if (flag!=4) // Show "Turn Right" on SLCD first time only
    {
    serout_byte(0,0xFE);
    serout_byte(0,0xC0);
    serout_text(0,"Turn Right");
    flag=4;
    }
    }
    else
    {motor_off();flag=0;} // Stop Motor if no key press
    }
    }

    ^
    ^
    It worked! with Remote Control (ER-4)

    But! How to work control with nokia 3230 (Infrared Phone)
    http://www.nokia.com/link?cid=EDITORIAL_520584

    Thank you for your read.
    Please suggest & Help me.

  2. #2
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: I want control AVR (ATMega8) Robot with Nokia 3230 (Infrared Phone)

    The IrDA API (specially the serial API RCommServ/RComm) might be what you are looking for.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: I want control AVR (ATMega8) Robot with Nokia 3230 (Infrared Phone)

    Since your device is an S60 2nd edition one, you can check Examples\SerialComms\ServerClientSide\GlassTerm.

Similar Threads

  1. Replies: 0
    Last Post: 2008-02-16, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×