ALL_DIGITAL = TruePORTB_PULLUPS = OnTRISA = %111111TRISB = %00000000TRISC = %00000000TRISD = %00000000TRISE = %111----------Arduino Controls----------arduino:If PORTA.2 = 1 And PORTA.3 = 1 ThenGoTo Forward_Slow ElseIf PORTA.2 = 0 And PORTA.3 = 1 ThenGoTo Left_Slow ElseIf PORTA.2 = 1 And PORTA.3 = 0 ThenGoTo Right_SlowElse If PORTE.0 = 1 And PORTE.1 = 0 Then GoTo Grab_Ball ElseIf PORTE.0 = 0 And PORTE.1 = 1 Then GoTo Back_Slow Else GoTo Rotate_Right EndIfEndIf GoTo main'----------Drive Controls----------Forward_Slow:High PORTD.0Low PORTD.1High PORTD.2Low PORTD.3Clear PORTDGoTo main Right_Slow:High PORTD.1High PORTD.2Clear PORTDGoTo mainLeft_Slow:High PORTD.0High PORTD.3Clear PORTDGoTo mainBack_Slow:Low PORTD.0High PORTD.1Low PORTD.2High PORTD.3Clear PORTDGoTo mainRotate_Right:Low PORTD.0High PORTD.1High PORTD.2Low PORTD.3DelayMS 500Clear PORTDGoTo main
I'm not famliar with using Basic on a PIC, but the '877A boots up with Port A pins all set to analog, and need to be changed for use as digital pins. I don't know if "ALL_DIGITAL = True" actual does this for Port A. In any case, you might try using one of the Port B or C pins for the input. Also, there is no indication in your code what the various configuration fuses are set to, nor what the oscillator setting is. Maybe the compiler takes care of that automatically, I don't know. Is this a Picaxe, or what?
A circuit diagram would help.The 16F887 code seems to be some kind of combinatorial logic that needs combinations of input pins to do anything.Are all the pins that are defined as inputs connected to something?
Test the arduino and pic individually to make sure that they behave as expected, then connect them together.Otherwise, you don't where the problems are.
Rather than diving head first and writing pages of code, just try a simple program with one switch in and one led out.
QuoteRather than diving head first and writing pages of code, just try a simple program with one switch in and one led out.This is always the proper way to proceed with new programs. Get the basic, simple stuffworking first, and then build around that.
just tried it an hour ago, and it doesnt work.. tried both active low and active high..
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16