Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Rick Waldron
@rwaldron
@lucas-sg when you get a chance, try this: npm install git://github.com/rwaldron/johnny-five.git#suspendable --save
You should now be able to call proximity.pause() to stop events from emitting
and then later proximity.resume() to restart
Lucas Sanz Gorostiaga
@lucas-sg
It says:
zsh: no matches found: git://github.com/rwaldron/johnny-five.git#suspendable
Rick Waldron
@rwaldron
weird. hold tight
Lucas Sanz Gorostiaga
@lucas-sg
I managed to install it by adding quotes before and after but I'm getting a message from the VSCode Linter saying Proximity doesn't have a pause or resume method since I'm using Typescript
And I think it needs to be implemented in DefinetelyTyped as well in order for it to work
Rick Waldron
@rwaldron
@lucas-sg I just ran npx typescript lib/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir types and generated a ./types. It will probably need more attention, but I think that get's you somewhere at least, right?
I should know this, considering I write TS exclusively at work 🤦‍♂️
reconbot
@reconbot:matrix.org
[m]
as any one would
Rick Waldron
@rwaldron
lol
Lucas Sanz Gorostiaga
@lucas-sg
I'm sorry Rick, I don't understand what lib/**/*.js is supposed to represent in my Electron (Node) project. I don't have a lib folder, unless it's well hidden in a specific folder under node_modules, and therefore the command won't run.
I'm sure there is something really silly and basic I'm missing from it but I'm kind of a noob in Typescript and Electron as you can see.
reconbot
@reconbot:matrix.org
[m]
Just use (proximity as any).pause() until he fixes the types
Rick Waldron
@rwaldron
@lucas-sg oh, I'm sorry—that wasn't meant to be for you to do anythng with, that was me experimenting with adding generated .d.ts files to johnny-five
Lucas Sanz Gorostiaga
@lucas-sg
@rwaldron sorry to bother you again with this but what does pause() actually do? I'm trying to plot a real-time plot with Plotly and when I use pause() it resets the plot. It does pause the reading but the unwanted effect is that I now need to save the plot data before hitting pause() so that it doesn't disappear, but stays there frozen instead.
Btw thanks @reconbot:matrix.org the as any cast worked fine :)
Rick Waldron
@rwaldron
@/all johnny-five's default branch has been renamed "main".
@lucas-sg I've published v2.1.0 which now has pause() and resume() on everything that's an event emitter!
Rick Waldron
@rwaldron
@lucas-sg All pause() does is copy the contents of the _events property into a weakmap, then set _events = {}
Your handlers won't be called until you resume(), which takes the object out of the weakmap and sets _events = ...
Can you share your code?
EJ2KDJ
@EJ2KDJ
Hi, does anyone know a place to ask a question about CH341? I’ve posted in the Arduino forum, I also went to the Nodebot Community Forum (URL is dead), the npm forum says it’s archived. I’m a beginner and I'm getting an error message that I can’t figure out.
reconbot
@reconbot:matrix.org
[m]
Do you have a link for it?
Donovan Buck
@dtex
@EJ2KDJ It looks like your not using the right command to load and run your js file. I think you're typing node run. You should instead pass the name of your js file like node myfile.js
EJ2KDJ
@EJ2KDJ
@dtex Thx for your reply, I believe I did what you suggested, however now i’m getting a new error and I posted it in the Arduino forum here:
https://forum.arduino.cc/t/ch341ser-error-when-trying-to-run-led/911832
EJ2KDJ
@EJ2KDJ

I’m getting this error when I run my script:

1637373588949 Connected COM4 
1637373588955 Available COM3 
1637373588956 Connected COM3 
1637373592592 Repl Initialized 
>> 1637373598958 Device or Firmware Error A timeout occurred while connecting to the Board.

I’ve checked the troubleshooting instructions on:

https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting

But, I’m still unable to fix it after installing StandardFirmata. FYI- I’m using an Arduino clone (CH341)

Am I on the right track? Any advice would be much appreciated.