​ ​ ​ ​ auto camera pointing - Page 5
Page 5 of 5 FirstFirst ... 3 4 5
Results 41 to 46 of 46

Thread: auto camera pointing

  1. #41
    Senior Member
    Join Date
    Jul 2011
    Location
    Los Angeles, CA
    Posts
    1,928

    Default

    IRIN is only for reading SIRC (Sony) codes from IR remotes.

  2. #42

    Default

    Thank you Hippy and Erco,
    The prototype is working. Need some refinement.

    I could not have done it without your help.
    Willy

  3. #43
    Senior Member
    Join Date
    Jul 2011
    Location
    Los Angeles, CA
    Posts
    1,928

    Default

    Congrats, Satchid! Would love to see some video of this amazing project!

  4. #44

    Default

    How do I send a video on the forum?

    The project is stil in pieses. The base and the pan is not connected at the moment

    Here te simple code for the pan:
    Code:
     ;sensor following camera panning
    '28x2 on shield Base and instant robot shield
    ' picaxe pin assignment for DC motor
    
    ;S.8 Motor A Direction
    ;S.9 Motor A Control (On/Off/PWM)
    ;S.10 Motor B Control (On/Off/PWM)
    ;S.11 Motor B Direction
    setfreq m16
    #picaxe 28x2
    
    
    #no_data 'Prevent data from being downloaded to PICAXE._
    	symbol sen_L   = pina.0 'Assign symbol sen1_in to input 0
    	symbol sen_R   = pina.1 'Assign symbol sen2_in to input 2
    	
    	symbol motor_A_dir = s.8  ;s.8 Motor A Direction
    	symbol motor_A	 = s.9  ;S.9 Motor A Control (On/Off/PWM)
    ;	symbol motor_B	 = s.10 ;S.10 Motor B Control (On/Off/PWM)
    ;	symbol motor_B_dir = s.11 ;S.11 Motor B Direction
    	
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
    		;P R O G R A M 
    start:	
    
    	b1 = sen_r ;not needed but for debug
    	b2 = sen_l ;not needed but for debug
          if sen_R = 0 and sen_L = 0 then gosub motorOFF 	;goto stop motor
    	if sen_R = 0 and sen_L = 1 then gosub right	
    	if sen_L = 0 and sen_R = 1 then gosub left
    
    ;	debug
    ;	pause 500
    left:
    High motor_A_dir 	;set direction of motor
    goto motorA		;goto start motor
    goto start
    
    right:
    low motor_A_dir	;set direction of motor
    goto motorA		;goto start motor
    goto start
    
    motorA:
    high motor_a    	;start motor
    goto start
    
    motorOFF:
    low motor_A		;stop motor
    goto start
    
    
    end
    Last edited by Satchid; 07-08-2017 at 08:34. Reason: code added

  5. #45
    Senior Member
    Join Date
    Jan 2010
    Location
    34 France
    Posts
    3,834

    Default

    Code:
    if sen_L = 0 and sen_R = 1 then gosub left
    ........
    left:
    High motor_A_dir     ;set direction of motor
    goto motorA        ;goto start motor
    goto start
    Manual2:
    The gosub (‘goto subprocedure’) command is a ‘temporary’ jump to a separate
    section of code, from which you will later return (via the return command). Every
    gosub command MUST be matched by a corresponding return command. Do not
    confuse with the ‘goto’ command which is a permanent jump to a new program
    location.
    S'il n'y a pas de solution, c'est qu'il n'y a pas de problème . (Les Shadoks)

  6. #46

Bookmarks

Posting Permissions

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