harbaum / ftduino Goto Github PK
View Code? Open in Web Editor NEWfischertechnik compatible arduino
fischertechnik compatible arduino
Hi,
I would like to synchronize two fischertechnik encoder motors. Are there any plans for adding this feature to the Ftduino library?
Thank you
Once that "Adafruit GFX Library" (https://github.com/adafruit/Adafruit-GFX-Library) is installed, the sketch compiles fine.
FtduinoDisplay.h
Vielleicht könnte das in die Dokumentation aufgenommen werden.
The manual "6.19 Bluetooth" contains no hint to the newly released BT-Adapter
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:
If I wasn't unsure of breaking the set-output commands, I would file a pull request...
I drag the input hat to the stage.
When I press the green flag the (hypothetical) code after the hat is exectued.
As soon as I begin to drag the hat to the stage an exception is thrown.
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
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;
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?
analog_input_broken.sb3.zip (You may have to remove the .zip
to import it into scratch.
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.
Led goes on, then off, then on again but the reading from analog input fails, so the led never goes off.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.