Digital Light Sensor & 4 Digit Display

HEY!

Any chances that the following sensors gets supported by GrovePi ?

Grove Digital Light Sensor & Grove 4 Digit Display

THX!

Sorry, we don’t have the libraries written for the Grove Digital Light Sensor and Grove 4 Digit Display and also don’t have an ETA for the libraries. Though, both the modules are supported by GrovePi and it’s only a matter of writing the libraries.

If you want to write the libraries yourself, we’ll be happy to help you out with that.

I have added support for the Grove 4 Digit Display to the stock 1.1 firmware

To display something you need to send i2c blocks to the GrovePi, which then forwards commands to the display.

I have added 9 new commands:

  1. Set decimal value with leading zeros
  2. Set decimal value without leading zeros
  3. Set brightness
  4. Send score, left and right numbers (2x 0-99)
  5. Set individual digit
  6. Set individual segment
  7. Analog read for N seconds
  8. Display entirely on (88:88)
  9. Display entirely off

I’ll add some python example of each command soon.

@Mcauser - thats nice! I´ll check it asap. THX!

@Karan - thx for the reply, but I think I let this do the pros, I am still a newbie :wink:

I’ve been testing the Grove Digital Light Sensor with a Raspberry Pi model B and a GrovePi with the latest firmware.

It works fine as long as your cable lenght isn’t to big (I2C really sucks for long distances. If I use a RJ45 connector and a shielded UTP cat6 cable longer than 2 m, the sensor isn’t recognized anymore).

I made my own python script using input from Adafruit and Keiichi Shima but made some alterations.

I put the script on GitHub: https://github.com/JohanVandewalle/Grove_Digital_Light_Sensor.

Hi Johan,
It would be great if you could send a pull request in the Dexter Industries repository too. We’ll be happy to integrate them with out current supported sensors.

Thanks,
Karan

Karan,

How must I send a pull request? It’s the first time a published something on GetHub.

To send us a pull request, first fork our Repository here: https://github.com/DexterInd/GrovePi . There is a “Fork” button on the top right side corner. As soon as you press it, it’ll create your fork and take you there. You’ll notice the change in the URL.

The next step is to create a local clone of the the Repository that you have just cloned. Follow the guide here: https://help.github.com/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork . The command should be like : git clone https://github.com/<user_name>/GrovePi.git .

Once you have cloned the repository, add the files that you want in the right directory using git add.

After adding the files, commit them using git commit.

Now you push the files to your fork: git push origin master.

Now open Github.com and go to your fork. You should notice the changes that you had made earlier appear there. Now click on “Pull Requests” on the right side and follow this: https://help.github.com/articles/using-pull-requests#sending-the-pull-request to complete the pull request.

Once you have sent the pull request, we’ll have a look if the code and structure. If it is good, we’ll merge it with the existing codebase.

I had taken a look at both your examples and they look pretty good. But since they are a bit advance and use the Adafruit I2C library, what I would suggest is that you create a folder in GrovePi/Software/Python folder and add both the libraries in the folder and add Readme’s and other files there too.

Git might be a bit cumbersome to start with and if you get lost in one of the steps, do let us know. We’ll help you out.

Thanks,
-Karan

Karan,

I just pulled one request in the Dexter Industries repository for the python scripts for both the grove digital light sensor and the grove barometic sensor. I’ve changed the files names so they have the same structure as the other files in that repository:

  • grove_i2c_digital_light_sensor.py
  • readme_grove_i2c_digital_light_sensor.MD
  • grove_i2c_barometic_sensor.py
  • grove_i2c_barometic_sensor_example.py
  • grove_i2c_barometic_sensor.pyx
  • readme_grove_i2c_barometic_sensor.MD

We just merged this! Thanks so much for the contribution!!

Any update on Phyton lib and script for the Grove 7 segment disp. I do not understand C…please help

Hey guys,
thanks for the great support :slight_smile:

any news regarding using the Grove 4 Digit Display with the GrovePi? @mcuser you mentioned something about providing Python examples on sending I2C blocks to the Display. Is there a way we can see these examples?

Thank you all

Hi,
I found an updated firmware on 's Github Page : https://github.com/mcauser/GrovePi-Firmware/blob/master/Firmware/grovepi_v1_4_digits/grovepi_v1_4_digits.ino .

Haven’t found the python code though, but might be easy to get done. Maybe @Mcauser can shed some light on the Python code that he used to test it.

-Karan

Thank you for the quick reply :slight_smile:

Since I am rather new with these things (I am only playing with them for two days), should I copy Mcauser’s code to the dependent_lib folder? Do I need to do anything else?

Thanks again

Hi,
You should use the Arduino IDE to compile Mcauser’s code and then upload it to the GrovePi. You’ll have to do some tweaking to the Python library too to send commands to the sensor.

-Karan