Giter Club home page Giter Club logo

Comments (12)

YukMingLaw avatar YukMingLaw commented on June 3, 2024

Hi,
The example code was removed.
You can refer to readme as a example code.

from arduinojoystickwithffblibrary.

waggy685 avatar waggy685 commented on June 3, 2024

Same for me.

from arduinojoystickwithffblibrary.

YukMingLaw avatar YukMingLaw commented on June 3, 2024

Hi,example code is added.https://github.com/YukMingLaw/ArduinoJoystickWithFFBLibrary/tree/master/examples/SingleJoystickFFB

from arduinojoystickwithffblibrary.

Scatman96 avatar Scatman96 commented on June 3, 2024

Hi,
how to interface the example code with a DIY Yoke/Joystick or stepper/DC-motors/BLDC`s with encoders ?

i hope its "easy" to do.

Can i use the "forces[0] is the X-Axis force data " "forces[1] is the Y-Axis force data" directly for the motor ? or do i need some "math" ?

thanks you very much for your great Library

from arduinojoystickwithffblibrary.

YukMingLaw avatar YukMingLaw commented on June 3, 2024

Hi,
The forces[0] is a data in range[-255,255].So if you use a DC-motor,just use it as a PWM value,Ofcourse use absolute value.
here is a sample:

if(forces[0] > 0){
  digitalWrite(4,HIGH);
  digitalWrite(5,LOW);
  analogWrite(7,abs(forces[0]));
}else{
  digitalWrite(4,LOW);
  digitalWrite(5,HIGH);
  analogWrite(7,abs(forces[0]));
}

If you use a BLDC-Motor or a steper-Motor,you should write some code to drive it.And bind this value forces[0] as the motor strength.
Hopes it can help you.

from arduinojoystickwithffblibrary.

Scatman96 avatar Scatman96 commented on June 3, 2024

ok thank you very much :)

So I understand that the encoders are on the output side of the joystick and have nothing to do with the force feedback? only the position of the joystick? Right ? :D

from arduinojoystickwithffblibrary.

storca avatar storca commented on June 3, 2024

Hello

I think that there are some mistakes in the example code, I'll take a look in 2-3hrs and make a pull request.

from arduinojoystickwithffblibrary.

Scatman96 avatar Scatman96 commented on June 3, 2024

i also have problems compiling

SingleJoystickFFB:15:1: error: 'mygains' does not name a type
mygains[0].springGain = 100;//0-100

from arduinojoystickwithffblibrary.

idrislaode avatar idrislaode commented on June 3, 2024

how to set ffb for steering wheel?

from arduinojoystickwithffblibrary.

idrislaode avatar idrislaode commented on June 3, 2024

i get error compiling

SingleJoystickFFB:14:1: error: 'mygains' does not name a type
mygains[0].totalGain = 100;//0-100
^~~~~~~
SingleJoystickFFB:15:1: error: 'mygains' does not name a type
mygains[0].springGain = 100;//0-100
^~~~~~~
C:\Users\User\AppData\Local\Temp\arduino_modified_sketch_694105\SingleJoystickFFB.ino: In function 'void loop()':
SingleJoystickFFB:41:21: error: 'forces' was not declared in this scope
Joystick.getForce(forces);
^~~~~~
C:\Users\User\AppData\Local\Temp\arduino_modified_sketch_694105\SingleJoystickFFB.ino:41:21: note: suggested alternative: 'fopen'
Joystick.getForce(forces);
^~~~~~
fopen
Using library ArduinoJoystickWithFFBLibrary-master at version 1.0.0 in folder: C:\Users\User\Documents\Arduino\libraries\ArduinoJoystickWithFFBLibrary-master
exit status 1
'mygains' does not name a type

from arduinojoystickwithffblibrary.

YukMingLaw avatar YukMingLaw commented on June 3, 2024

Hi,All.
The new example code is available and successful in compiling.

from arduinojoystickwithffblibrary.

Scatman96 avatar Scatman96 commented on June 3, 2024

Hi,All.
The new example code is available and successful in compiling.

Hi,
could you comment on the codes so everyone knows what's going on there?

    pinMode(A2,INPUT);
    pinMode(9,OUTPUT);
    pinMode(6,OUTPUT);
    pinMode(7,OUTPUT);

int value = analogRead(A2);

thank you very much for your fast correction of the example sketch

from arduinojoystickwithffblibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.