Skip to content

Instantly share code, notes, and snippets.

View cesar-ca's full-sized avatar
🇭🇳
Working

César Castro García cesar-ca

🇭🇳
Working
View GitHub Profile
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "imported-longer",
"metadata": {},
"outputs": [],
"source": []
},
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Problem 3",
"provenance": []
},
"kernelspec": {
"name": "python3",
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Problem 2",
"provenance": []
},
"kernelspec": {
"name": "python3",
/*
Moves the end effector of a SCARA robotic arm based on the
desired x and y linear velocities. Motion is calculated using
the Jacobian matrix which relates joint velocities to end effector velocities
Note that Servo 0 = Joint 1 and Servo 1 = Joint 2
*/
// Use VarSpeedServo.h library
#include <VarSpeedServo.h>
# Wokwi Library List
# See https://docs.wokwi.com/guides/libraries
VarSpeedServo@wokwi:33c23caf83fc8df02cd6f2219d37e36f37f0bd24
{
"version": 1,
"author": "César Castro",
"editor": "wokwi",
"parts": [
{ "type": "wokwi-arduino-mega", "id": "mega", "top": -27.63, "left": -22.78, "attrs": {} },
{ "type": "wokwi-servo", "id": "servo1", "top": 35.17, "left": 426.3, "attrs": {} },
{ "type": "wokwi-servo", "id": "servo2", "top": -133.22, "left": 420.99, "attrs": {} }
],
"connections": [
#include <VarSpeedServo.h>
#define SERVOS 2
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
VarSpeedServo myservo[SERVOS];
#include <VarSpeedServo.h>
#define SERVOS 2
VarSpeedServo myservo[SERVOS];
const int desired_speed = 75;
int servo_pins[SERVOS] = {3,5};