0 answer
Published by

All the code and documentation for CrcLib (our Arduino library) can be found here!

Published on 2019-10-29

1 answer
Published by

Our school might not have any programmers that will be able to come the workshop therefore we might need some help. Like asked before, are there any other places we can visit at least online. If there is it will be very appreciated as well, it could help all teams so that we can overview of the information and not only receiving it once. Also just as a side note, for schools such as our (a high school) could it be possible to include definitions of the code, I saw that you put up code as a response to the another question and I, with others didn't understand what any of it was for. Please consider our request. 

-LTM Student 
Published on 2019-11-04

2 answers
Published by

I can't seem to get the post to show up. Not sure why.

EDIT:

I wanted to learn about the CRCLib so I wrote a piece of code to output the button values and the Joystick

Values. This is not beautiful, but it is functional.

You need to use the Tools->Serial Monitor to see the output. Arduino debugging is a pain. The output is ugly, scrolling continuously, but that is the way the serial communication works.

USB connect to the 9660, link the manette, run the serial monitor and you are off.

Code is at the bottom

-Chris

CodeBlock

#include <CrcLib.h>
using namespace Crc;
void setup()
{
    CrcLib::Initialize();
    //Not necessary
    Serial.begin(19200);
}
void loop()
{
    CrcLib::Update();
  unsigned char LjoyY = Crc::CrcLib::ReadAnalogChannel(ANALOG::LCHANY);
  unsigned char LjoyX = Crc::CrcLib::ReadAnalogChannel(ANALOG::LCHANX);
  unsigned char RjoyY = Crc::CrcLib::ReadAnalogChannel(ANALOG::RCHANY);
  unsigned char RjoyX = Crc::CrcLib::ReadAnalogChannel(ANALOG::RCHANX);
  bool selectButton = CrcLib::ReadDigitalChannel(BUTTON::SELECT);
  bool startButton = CrcLib::ReadDigitalChannel(BUTTON::START);
  bool L1Button = CrcLib::ReadDigitalChannel(BUTTON::L1);
  bool L2Button = CrcLib::ReadDigitalChannel(BUTTON::L2);
  bool L3Button = CrcLib::ReadDigitalChannel(BUTTON::L3);
  bool R1Button = CrcLib::ReadDigitalChannel(BUTTON::R1);
  bool R2Button = CrcLib::ReadDigitalChannel(BUTTON::R2);
  bool R3Button = CrcLib::ReadDigitalChannel(BUTTON::R3);
  bool upButton = CrcLib::ReadDigitalChannel(BUTTON::UP);
  bool rightButton = CrcLib::ReadDigitalChannel(BUTTON::RIGHT);
  bool downButton = CrcLib::ReadDigitalChannel(BUTTON::DOWN);
  bool leftButton = CrcLib::ReadDigitalChannel(BUTTON::LEFT);
  bool greenButton = CrcLib::ReadDigitalChannel(BUTTON::GREENONE);
  bool redButton = CrcLib::ReadDigitalChannel(BUTTON::REDTWO);
  bool blueButton = CrcLib::ReadDigitalChannel(BUTTON::BLUETHREE);
  bool pinkButton = CrcLib::ReadDigitalChannel(BUTTON::PINKFOUR);
  
   Serial.print(" L2-");Serial.print(L2Button); 
   Serial.print(" R2-");Serial.print(R2Button); 
   Serial.print(" L1-");Serial.print(L1Button); 
   Serial.print(" R1-");Serial.print(R1Button);
   Serial.print(" L3-");Serial.print(L3Button);  //no idea what button this is 
   Serial.print(" R3-");Serial.print(R3Button);  //no idea what button this is 
   Serial.print(" SEL-");Serial.print(selectButton); 
   Serial.print(" STAR-");Serial.print(startButton); 
   Serial.print(" up-");Serial.print(upButton); 
   Serial.print(" down-");Serial.print(downButton);
   Serial.print(" right-");Serial.print(rightButton); 
   Serial.print(" left-");Serial.print(leftButton);
   Serial.print(" G1-");Serial.print(greenButton); 
   Serial.print(" Re2-");Serial.print(redButton);
   Serial.print(" B3-");Serial.print(blueButton); 
   Serial.print(" P4-");Serial.print(pinkButton);
   Serial.print(" LJoy(");Serial.print(LjoyX); Serial.print(",");Serial.print(LjoyY); Serial.print(")");
   Serial.print(" RJoy(");Serial.print(RjoyX); Serial.print(",");Serial.print(RjoyY); Serial.print(")");
   Serial.println();   
}
EDIT:

Problem was the screenshot I was trying to include. Maybe I exceeded a maximum post size?

EDIT:

Please note that the serial communication rate is bumped to 19200 baud instead of the default 9600. You need to change the rate on the serial monitor to match or you will get output that looks like is is written in Cyrillic.

Published on 2019-11-09

1 answer
Published by

Good afternoon everyone,

We are having some problems with the code for the 9880. What we are trying to do is simply make an attached servo move to test the connection. However, as you can imagine, we were unsuccessful. Due to the wiki being incomplete, it wasn't the easiest task to figure out how to do that simple of a task. Anyways, anything wrong with the code? When I run it, the Arduino just makes a constant buzzer noise with no pattern, furthermore complicating the situation as the error we're experiencing is undocumented. In addition, is it possible to have a code snippet posted in order to achieve our goal? 

- Bogdan


Code made to run servo:

#include <CrcLib.h>

using namespace Crc;

#define  MOTOR CRC_PWM_5


void setup()

{

    CrcLib::Initialize();


    CrcLib::InitializePwmOutput(CRC_PWM_5);


    CrcLib::SetDigitalPinMode(CRC_DIG_4, OUTPUT);


    //Not necessary

    Serial.begin(9600);

}


void loop()

{

    CrcLib::SetPwmOutput(CRC_PWM_5, 50);

    delay(10000);

    //Not necessary

    unsigned int deltaMicros = CrcLib::GetDeltaTimeMicros();

    Serial.println(deltaMicros);

}


/*void Test(unsigned char pin, BUTTON button1, BUTTON button2){

  if(CrcLib::ReadDigitalChannel(button1) || CrcLib::ReadDigitalChannel(button2){

    CrcLib::SetDigitalOutput(pin, HIGH);

  }

  else{

    CrcLib::SetDigitalOutput(pin, LOW);

  }

} */

Published on 2019-11-27

1 answer
Published by

Just wanted to give fair warning that the USB connector on our Arduino Mega wasn't properly soldered to the board. After only a few gentle plugs/unplugs our programmer pulled it off the board yesterday.

I've just ordered 2 replacements from RobotDyn. If it's within your means it might be worth obtaining a backup in case your board suffers from the same cold solder at a critical point. Here's the order link I used.

Published on 2019-12-04

3 answers
Published by

Quand nous changeons brusquement la direction (avant arrière, gauche avant, peu-importe) du joystick, l'arduino redémarre à chaque fois.  Si on regarde nos moteurs, on voit de la lumière dans le bobinage. Peut-on changer cela avec notre code et si oui, comment ?

Voici notre code:

#include <CrcLib.h>
en utilisant l'espace de noms Crc;

void setup() 
{

  CrcLib :: Initialize ();

  CrcLib :: InitializePwmOutput (CRC_PWM_5);
  CrcLib :: InitializePwmOutput (CRC_PWM_6);
  CrcLib :: InitializePwmOutput (CRC_PWM_9);
  CrcLib :: InitializePwmOutput (CRC_PWM_10);
  //Serial.println("Allo ");
}

boucle vide () 
{
  // mettez ici votre code principal, à exécuter de manière répétée:
  CrcLib :: Update (); 

  CrcLib :: MoveArcade (ANALOG :: LCHANY, ANALOG :: LCHANX, CRC_PWM_5, CRC_PWM_6, CRC_PWM_9, CRC_PWM_10);

}

EDIT:

Le code a été automatique traduit, c'est étrange.

Voici le lien vers les vidéos de la situation :

https://drive.google.com/file/d/1EicXWimK6HhYjv_xfDEDrHt7gvaG2-Ko/view?usp=sharing
https://drive.google.com/open?id=1F2Sd6n-BqqaRf-0_ILAmfz6ls2kNbWQN

EDIT:

Le code a été automatique traduit, c'est étrange.

Voici le lien vers les vidéos de la situation :

https://drive.google.com/file/d/1EicXWimK6HhYjv_xfDEDrHt7gvaG2-Ko/view?usp=sharing
https://drive.google.com/open?id=1F2Sd6n-BqqaRf-0_ILAmfz6ls2kNbWQN

EDIT:

Voici le lien du deuxième vidéo qui ne fonctionnait pas.
https://drive.google.com/file/d/1EicXWimK6HhYjv_xfDEDrHt7gvaG2-Ko/view?usp=sharing

EDIT:

Finalement le bon lien : 
https://drive.google.com/file/d/1F2Sd6n-BqqaRf-0_ILAmfz6ls2kNbWQN/view?usp=sharing

Published on 2020-01-07

4 answers
Published by

Hello,

I've experienced an error with one of my motors, more specifically CRC_PWM_3. What I've set up is a custom Mechanum wheel movement setup (shows up as "Belise" in the code provided below). In short, I wanted to set up a 5th motor for a separate function which isn't correlated with the Mechanum movement. However, the same 

void Test(int MyPWM){}

works just fine in a separate tab. Anything I did wrong?

- Bogdan

#include <CrcLib.h>
using namespace Crc;

void setup() 
{

  CrcLib::Initialize();

  CrcLib::InitializePwmOutput (CRC_PWM_3); // multi-use motor
  CrcLib::InitializePwmOutput (CRC_PWM_5); // front left
  CrcLib::InitializePwmOutput (CRC_PWM_7); // back left
  CrcLib::InitializePwmOutput (CRC_PWM_9, true); // front right
  CrcLib::InitializePwmOutput (CRC_PWM_11); // back right
  CrcLib::SetDigitalPinMode(CRC_DIG_4, OUTPUT); // multi-use motor digital output

  Serial.begin(9600);  
}

void loop() 
{
  CrcLib::Update();
  //bool L2Button = CrcLib::ReadDigitalChannel(BUTTON::L2);
  unsigned char LjoyY = LjoyY = Crc::CrcLib::ReadAnalogChannel(ANALOG::LCHANY);
  unsigned char LjoyX = LjoyX = Crc::CrcLib::ReadAnalogChannel(ANALOG::LCHANX);
  unsigned char RjoyY = RjoyY = Crc::CrcLib::ReadAnalogChannel(ANALOG::RCHANY);
  unsigned char RjoyX = RjoyX = Crc::CrcLib::ReadAnalogChannel(ANALOG::RCHANX); 

  CrcLib::Belise (ANALOG :: LCHANY, ANALOG :: LCHANX, ANALOG::RCHANX, CRC_PWM_5, CRC_PWM_7, CRC_PWM_9, CRC_PWM_11);

  Test(8);
}

void Test(int MyPWM)
{
  if (CrcLib::ReadDigitalChannel(BUTTON::L2)) {
    CrcLib::SetDigitalOutput(CRC_DIG_4, HIGH);
    CrcLib::SetPwmOutput(CRC_PWM_3, 127);
    bool L2Button = CrcLib::ReadDigitalChannel(BUTTON::L2);
    Serial.print(" L2-"); Serial.println(L2Button);
  }

    else {
    CrcLib::SetDigitalOutput(CRC_DIG_4, LOW);
    CrcLib::SetPwmOutput(CRC_PWM_3, 0);
    Serial.println("noButt");
  }
}
Published on 2020-01-25