Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Roboteq_SDC_serie by
Revision 7:9a17b688dd59, committed 2016-07-11
- Comitter:
- kkoichy
- Date:
- Mon Jul 11 10:33:59 2016 +0000
- Parent:
- 6:bd10b47f59d2
- Commit message:
- Added comments
Changed in this revision
Roboteq.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Roboteq.h Thu Jun 16 12:30:29 2016 +0000 +++ b/Roboteq.h Mon Jul 11 10:33:59 2016 +0000 @@ -1,14 +1,27 @@ -/* Example programm for Nucleo F446RE : + +/**************************************************/ +/* Roboteq class : inherits from CANopen_node + - Contains : node-id, identifier of the node to communicate with, range from 1 to 127 + can, pointer to the CAN instance used to communicate with the node + + - Methods : 2 constructors, 1 of them setting the frequency of the CAN bus + Getters and setters for every variable + Send SDO up- and download, to send and receive basic messages over CANopen protocol + Every commands detailled in the SDC21XX serie documentation under the title Object Dictionnary + A SetParameters method, allowing to set acceleration, deceleration and velocity for one of the two channels of the motor controller +*/ +/**************************************************/ + +/**************************************************/ +/* Example programm Two motors are connected to 2 SDC21XX controllers, both on channel 1. When pressing the user button, 2 CANopen frames are sent, setting the motors to go to the position referred to as +/- 1000 - ************************************************************ #include "mbed.h" #include "Roboteq.h" -#include "CAN.h" -InterruptIn Button(PC_13); +InterruptIn Button(p28); Serial pc(USBTX,USBRX); -CAN Can(PA_11, PA_12); +CAN can(p30, p29); Roboteq Robot_Moteur1(4, &Can); Roboteq Robot_Moteur2(5, &Can); int i = 0, j = 1; @@ -28,8 +41,6 @@ pc.printf("\n\rdebut prog"); Button.fall(&send); - - while(1) {