0

I am doing a class project involving an Arduino Uno and a Picaxe 14m2.

I am in the middle of attempting to code a program for the Arduino Uno that will allow me to send and output value to the input on the Picaxe.

So in layman's, this is what I wish to achieve:

I want the Arduino to check a sensor, and if the sensor returns a specific value. (- I know this part, but not the next.) I then want the Arduino to send a value (HIGH, or 1 .. something like that) as an output to one of the Picaxe input pins. I then need the Picaxe to notice a value has been sent, and then do something else.

Any help would be appreciated. Thanks.

qfwfq
  • 2,416
  • 1
  • 17
  • 30

2 Answers2

0

If you are looking for that, you may want to specify what kind of PICAXE you have. Since there is a difference in the types of these chips.

After that you may wanna look over the datasheet of the PICAXE so that you can find the instructions set and the type of program memory you have, "EEPROM....".

After that:

  1. List your Is/Os, inputs and outputs.
  2. Set your source code editor.
  3. Write the source code and burn it to the PICAXE program memory.(C, Assembly...)
  4. Write your Arduino code, setting the Is/Os and telling the Arduino how to deal with the signals in and out.(C language)
  5. Make a circuit diagram for the hardware you are going to connect between both chips.
  6. Don't forget to see the loading effects on both the Arduino and the PICAXE, because you don't want to burn your project hardware after all.
  7. Test your project and note that you will have to troubleshoot both software and hardware whenever a problem occurs.

I suggest that you use the Oscilloscope to test the signals going in or coming out of both circuits + the sensor's signal.

  • For any extra thing you need the PICAXE to do, use If statements, because they are not so technical to implement and they are easy to write and troubleshoot.

For your scheme, you are actually making the Arduino give instructions to the PICAXE through a variable signal coming from a sensor.

^send me feedback and I will help more.

0

You will probably want to look into using UART (aka Serial) or i2c communication.

Serial communication should work with any PICAXE and Arduino, While i2c Will only work if you are using the X2 Series PICAXE Chips. i2c's main advantage is when using multiple slave devices (plus the master device, i.e. more than just 2 devices total) in which you can use the same two wires for up to around 128 devices. Serial (UART) communication is simpler, and only needs one wire (plus a common ground) to send data one way, it is what i'll show for the rest of this answer

Here is the manual entry for serial input for the PICAXE, and Here's the entry for serial output from the Arduino. The code you will need given your question will be something like the following:

For the arduino:

void setup(){
  Serial.begin(9600);
}
void loop(){
   if (conditionMet){    //whatever the condition is in your code
       int bytesSent = Serial.write(“HIGH”); //send the string “HIGH"
   }
}

and for the PICAXE:

main:
    serin 6, T9600, ("HIGH")  'uses qualifier to look for exact message "HIGH"
    'do whatever when criteria met
goto main
Patronics
  • 1,351
  • 1
  • 16
  • 27