Giter Club home page Giter Club logo

Comments (6)

MrYsLab avatar MrYsLab commented on August 29, 2024 1

Each sensor type may have a different set of timing requirements. Some require a request for a sample and then require a wait for the data to return. The DHT11 for example requires a wait of 1 second, while the DHT 22 requires a wait of 2 seconds. Accommodating different sensor types would involve providing a block to configure the sensor type, adding additional complexity. It sounds simple but the details of implementation are not.
I am not sure what a "generic" sensor from Aliexpress is, and so I cannot determine how difficult it would be to implement. If it is a standard part with a standard part number and that adheres to the specs for that part, it may be possible, but without that information, it would be rather difficult.
I am not likely to implement the code for this, but if you would like to try your hand at an implementation, I would be happy to try and provide guidance.

from s3onegpio.

MrYsLab avatar MrYsLab commented on August 29, 2024

It is possible, and in fact, outside of the Scratch extensions, for Arduino boards, the DHT22 type sensor is supported. The reason that the DHT22 or other temperature/humidity sensors are not supported for Scratch, is that if I support one sensor, inevitably a request would come in for another. Also, streaming type interfaces tend to be complex to support in the context of Scratch.
Currently, the Scratch blocks support the most common digital and analog functionality for the boards supported with some minor exceptions.
What specific sensor are you referring to?

from s3onegpio.

pacebrian0 avatar pacebrian0 commented on August 29, 2024

I am using generic humidity and temperature sensors from Aliexpress. They only require vcc, gnd and out signal. I might be underestimating the work required here, but would it be possible to have a block that reads such a stream of incoming data, or it needs to be defined depending on the type of data being sent from the sensor (i.e. boolean, float, int..)?

from s3onegpio.

pacebrian0 avatar pacebrian0 commented on August 29, 2024

Thanks for your patience and insight. I will do more research on the matter and get back to you.

Thank you for your fast responses and stay safe

from s3onegpio.

suoko avatar suoko commented on August 29, 2024

Each sensor type may have a different set of timing requirements. Some require a request for a sample and then require a wait for the data to return. The DHT11 for example requires a wait of 1 second, while the DHT 22 requires a wait of 2 seconds. Accommodating different sensor types would involve providing a block to configure the sensor type, adding additional complexity. It sounds simple but the details of implementation are not. I am not sure what a "generic" sensor from Aliexpress is, and so I cannot determine how difficult it would be to implement. If it is a standard part with a standard part number and that adheres to the specs for that part, it may be possible, but without that information, it would be rather difficult. I am not likely to implement the code for this, but if you would like to try your hand at an implementation, I would be happy to try and provide guidance.

Did you write a sort of tutorial on how to implement the support for other sensors or devices ? Let's think of DHT, LCD panels, etc... which might require extra libraries.

from s3onegpio.

MrYsLab avatar MrYsLab commented on August 29, 2024

@suoko One must understand how to extend the Scratch side and appropriate hardware support on the board side to add additional support.

My blog has a 5 part posting describing what is involved on the Scratch side. The first part may be found here.

To easily find the other articles, please look at this page.

On the board side, you must modify the appropriate gateway and its associated board control library. For example, the Arduino AVR boards use pymata-express.

The gateways are built using yet another package called python banyan using the OneGPIO concept.

As you can see, adding functionality is a challenging task. However, if you have any specific questions, I am always happy to try to answer them.

from s3onegpio.

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.