Hello everyone. Im stuying about arduino Can Bus project but i have some problem with it.
First of all the project has 1 arduino mega and 4 pro mini(they have servo motors), all of them will communicate with can bus module. In this project Arduino mega send the order all of the pro minis and pro minis -if they have work to do- start their works. But they are not starting. Modules couldnt do their jobs.
Can you help me please thank you
Also when i start modules i get only Can Bus OK message i cant get the feedback
alfamanager:
Hello everyone. Im stuying about arduino Can Bus project but i have some problem with it.
First of all the project has 1 arduino mega and 4 pro mini(they have servo motors), all of them will communicate with can bus module. In this project Arduino mega send the order all of the pro minis and pro minis -if they have work to do- start their works. But they are not starting. Modules couldnt do their jobs.
Can you help me please thank you
Also when i start modules i get only Can Bus OK message i cant get the feedback
oh yes sure we can help... the problem is so obvious!
oh wait... sorry we can't help solving your problem without your code or a schematic our you CAN network... or should we try a crystal ball??
#include <Adafruit_NeoPixel.h> #ifdefAVR #include <avr/power.h> #endif #include <SPI.h> //SPI is used to talk to the CAN Controller #include <mcp_can.h>
Serial.begin(115200); // Initiates the serial to do the monitoring
Serial.println("module");
Serial.println(); //Print function list for user selection
stmp1 [0]= char (Item);
for (int i = 1 ; i <= 1; i++)
{
stmp1 = 0;
}*
stmp1 [1] |= (1 << 0);*
stmp1 [1] |= (1 << 1);*
stmp1 [1] |= (1 << 2);*
stmp2 [2] |= (1 << 0);*
stmp2 [2] |= (1 << 1);*
stmp2 [2] |= (1 << 2);* START_INIT:
if (CAN_OK == CAN.begin(CAN_250KBPS)) *
{*
Serial.println("CAN BUS Shield init ok!");*
}*
else*
{*
Serial.println("CAN BUS Shield init fail");*
Serial.println("Init CAN BUS Shield again");*
_delay_us(100);*
goto START_INIT;*
}*
pixels.begin(); // This initializes the NeoPixel library.*
pinMode (Led, OUTPUT) ;// define LED as output interface*
first: please read the how to use this forum and learn how to post code. If you know how to post code - edit your post.
second: tell us: which canbus library you are using. post a LINK (clickable!) to your library
third: tell us: have you successfully tried the can_send and can_receive example - which are coming with most of the libraries, and were these examples sucessfull with your hardware?