Giter Site home page Giter Site logo

harbaum / ftduino Goto Github PK

View Code? Open in Web Editor NEW
31.0 8.0 10.0 196.3 MB

fischertechnik compatible arduino

C++ 33.75% C 2.08% Python 0.26% Shell 0.17% JavaScript 30.34% HTML 31.72% Java 0.93% CSS 0.47% Makefile 0.07% Prolog 0.21%
fischertechnik arduino construction-kit

ftduino's People

Contributors

fecavy avatar ft-extender avatar harbaum avatar intrigus avatar peterdhabermehl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ftduino's Issues

Synchronize encoder motors

Hi,

I would like to synchronize two fischertechnik encoder motors. Are there any plans for adding this feature to the Ftduino library?

Thank you

I2CSlave example: motor control bug

Controlling M1 is no problem, but M2, M3 and M4 don't work.

According to the manual, the following code should set M2 to turn right at 100% speed, but instead the motor attached at M3 starts to rotate.

#include <Wire.h>

void setup() {
  Wire.begin(); // join I2C bus as master
}


void startMotor() {
  Wire.beginTransmission(43); // connect to 0x2B slave ftDuino
  Wire.write(0x04);           // set output mode of O3/M2 to...
  Wire.write(0x13);           // ... motor output right
  Wire.endTransmission();
  delay(100);
  Wire.beginTransmission(43); // connect again
  Wire.write(0x05);           // set output value of M2 to...
  Wire.write(255);            // ... full speed
  Wire.endTransmission();
}

void loop() {
  startMotor();

  delay(3000);
}

I modified I2CSlave a little bit to track the issue down in the code:
I2cSlaveDebug2.ino.txt

It produces the following (slightly modified) output explaining the bug's origin:

---- turn M1 to the right (100%) (OK) ------------
I2C receive...
addr:	0
value:	13
port:	0
reg:	0
Set output mode: 0	=	13
I2C receive...
addr:	1
value:	FF
port:	0
reg:	1
Configure Hardware...
Check passed.
PWM:	64
mode:	0
Set motor 0	to	2	at	64


---- turn M2 to the right (100%) (FAIL) ---------
I2C receive...
addr:	4	(OK)
value:	13	(OK)
port:	2	(OK)
reg:	0	(OK)
Set output mode: 2	=	13	(OK) (O3 set to motor mode)
I2C receive...
addr:	5	(OK)
value:	FF	(OK)
port:	2	(FAIL)
reg:	1	(OK)
Configure Hardware...
Check passed.
PWM:	64	(OK)
mode:	0	(OK)
Set motor 2	to	2	at	64	(FAIL)

Looks like the motor port is not calculated correctly.
Port 2 can be Ftduino::O3 (that works), but also Ftduino::M2.

Motor ports would require to be shifted 1 to the right to calculate them correctly:

  • Motor offset from M1: port>>1
  • M1: 0>>1 (=0)
  • M2: 2>>1 (=1)
  • M3: 4>>1 (=2)
  • M4: 6>>1 (=3)

If I wasn't unsure of breaking the set-output commands, I would file a pull request...

Scratch3] Input hat seems to be broken

Used scratch file:

image

Expected behaviour:

I drag the input hat to the stage.
When I press the green flag the (hypothetical) code after the hat is exectued.

Actual behaviour:

As soon as I begin to drag the hat to the stage an exception is thrown.

Error:

lib.min.js:270125 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Scratch3FtduinoBlocks.parse (lib.min.js:270125)
    at serial.Port.port.onReceive (lib.min.js:270200)
    at lib.min.js:269660
parse @ lib.min.js:270125
port.onReceive @ lib.min.js:270200
(anonymous) @ lib.min.js:269660
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269662
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269685
Promise.then (async)
serial.Port.connect @ lib.min.js:269684
connect @ lib.min.js:270179
(anonymous) @ lib.min.js:270233
Promise.then (async)
autoConnect @ lib.min.js:270226
Scratch3FtduinoBlocks @ lib.min.js:269853
loadExtensionURL @ lib.min.js:265657
handleItemSelect @ lib.min.js:328425
wrapper @ lib.min.js:71256
handleSelect @ lib.min.js:316886
wrapper @ lib.min.js:71256
handleClick @ lib.min.js:329111
wrapper @ lib.min.js:71256
callCallback @ lib.min.js:83398
invokeGuardedCallbackDev @ lib.min.js:83437
invokeGuardedCallback @ lib.min.js:83294
invokeGuardedCallbackAndCatchFirstError @ lib.min.js:83308
executeDispatch @ lib.min.js:83692
executeDispatchesInOrder @ lib.min.js:83711
executeDispatchesAndRelease @ lib.min.js:83812
executeDispatchesAndReleaseTopLevel @ lib.min.js:83823
forEachAccumulated @ lib.min.js:83791
processEventQueue @ lib.min.js:83968
runEventQueueInBatch @ lib.min.js:86463
handleTopLevel @ lib.min.js:86472
handleTopLevelImpl @ lib.min.js:86203
batchedUpdates @ lib.min.js:93938
batchedUpdates @ lib.min.js:85186
dispatchEvent @ lib.min.js:86277

image

FTDuino can not connect using WebUSB, Scratch nor Brickly

Hi, just got the FTDuino in the mail and wrote the first few programs, now I wanted to use Scratch so I downloaded the IOServer software as described in the manual.

On my Win10 machine when I try to connect using the online Scratch editor nothing shows up in the popup window;
Screenshot
When i do the same thing on my linux machine (Debian 10 Mate on a i386 architecture) usin' Chromium FTDuino shows up in de selection window, however when I try to connect. An error is returned: "Connection error: NotFoundError: The interface number provided is not supported by the device in its current configuration."
Can you please comment on this behaviour?

[Scratch3] Analog input reading functions break with invalid ports.

Used scratch file:

analog_input_broken.sb3.zip (You may have to remove the .zip to import it into scratch.

image

Expected behaviour:

Led goes on, then off, then on again and finally after reading from analog input (effectively discarding the result) it should go off again.
Note that I'm reading from Port "0" which obviously is invalid.

Actual behaviour:

Led goes on, then off, then on again but the reading from analog input fails, so the led never goes off.

Error:

lib.min.js:270125 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Scratch3FtduinoBlocks.parse (lib.min.js:270125)
    at ./node_modules/scratch-vm/src/extensions/scratch3_ftduino/index.js.serial.Port.port.onReceive (lib.min.js:270200)
    at lib.min.js:269660
parse @ lib.min.js:270125
port.onReceive @ lib.min.js:270200
(anonymous) @ lib.min.js:269660
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269662
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269662
Promise.then (async)
readLoop @ lib.min.js:269659
(anonymous) @ lib.min.js:269685
Promise.then (async)
./node_modules/scratch-vm/src/extensions/scratch3_ftduino/index.js.serial.Port.connect @ lib.min.js:269684
connect @ lib.min.js:270179
(anonymous) @ lib.min.js:269872
Promise.then (async)
manualConnect @ lib.min.js:269869
onConnectClicked @ lib.min.js:269748

image

Logo Proposal for ftDuino

Hello, I wish to cooperate with ftDuino, for this reason I have decided to design a logo for it. If you like this proposal, I can send you the files.

You can suggest the changes you think are necessary.

PROPUESTA_LOGO_FTDUINO.jpg

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.