Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation changes (second half): Use only a single README.md per device #1610

Merged

Conversation

krwq
Copy link
Member

@krwq krwq commented Jul 21, 2021

@Ellerbach is doing first part

The idea is that samples/README.md should not exist and only one README.md file per device should be used.

This will make it easier to make READMEs visible in the documentation.

Microsoft Reviewers: Open in CodeFlow

@krwq krwq requested a review from Ellerbach July 21, 2021 14:40
@ghost ghost added the area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio label Jul 21, 2021

![Sample Result](RunningResult.jpg)

## Hardware Required
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go first in the usage section

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for circuit

* Male/Female Jumper Wires

### Circuit
![](MLX90614_circuit_bb.jpg)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
![](MLX90614_circuit_bb.jpg)
![Schematics](MLX90614_circuit_bb.jpg)

Comment on lines 64 to 67


This sample demonstrates how to read channel statuses using auto-refresh configuration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This sample demonstrates how to read channel statuses using auto-refresh configuration.

@@ -47,10 +104,11 @@ private static void Receiver_ReceivedData(object sender, DataReceivedEventArgs e
}
Console.WriteLine();

Console.WriteLine($"Message: {msg}");
Console.WriteLine($"Massage: {msg}");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Console.WriteLine($"Massage: {msg}");
Console.WriteLine($"Message: {msg}");

@@ -124,7 +128,7 @@ var bitmap3 = BitmapToByteArray(bitmapLarge);

Note: you may want to reverse the colors first depending on what you want.

## Advance functions
### Advance functions
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Advance functions
### Advanced functions


## Board

![](Circuit_DS1307_bb.png)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
![](Circuit_DS1307_bb.png)
![Schematics](Circuit_DS1307_bb.png)


This sample duplicates the functionality of the rpi-more-blinking-lights sample but instead of using the raspberry pi Gpio it uses the Seesaw breakout board for all inputs

![](SeesawSampleBlinkingLights_bb.png)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
![](SeesawSampleBlinkingLights_bb.png)
![Schematics](SeesawSampleBlinkingLights_bb.png)

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments on few files. I left you Markdown tips as well to help correcting some of the docs.


- https://www.st.com/resource/en/datasheet/lps25h.pdf

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you are at adjusting those elements, make it with the proper pattern so something like:

Official LPS25H documentation can be found [here](https://www.st.com/resource/en/datasheet/lps25h.pdf)

I've tried to adjust all those URLs as well

return I2cDevice.Create(settings);
}
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown tip: you need to finish the file with an empty line, so adding an extra enter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the other Markdown tips left there and there :-) the enum at the beginning of the file is not correct as it should havre an empty line before also reinforce by the fact you have a title.


**Max31856** [datasheet](https://datasheets.maximintegrated.com/en/ds/Max31856.pdf)

## Usage
The Max31856.samples file contains a sample usage of the device. Note that this reads two temperatures. One is a connected thermocouple reading which can be read using the ```TryGetTemperature``` command and the other is the temperature of the device itself which can be read using the ```GetColdJunctionTemperature``` command. The Cold Junction Temperature is used internally to increase the accuracy of the thermocouple but can also be read if you find a use for it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marktdown tips:

  • all titles except the first level one, must have an empty line and an empty line after.
  • all code blocks need to be separated with an empty line before and after
  • al enums need to be grouped without extra enter between them
  • for code blocks, use only "csharp" and not the c# version, all lowercase

```

Create a new ```SpiDevice``` with the settings from above. Then create a new Max31856 device with the ```SpiDevice``` as well as the correct ```ThermocoupleType``` (see note below)
```csharp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so here you miss an enter before the code block

You can use .NET Core to drive MAX7219 based Dot Matrix Modules.

These Modules can be cascaded to get a bigger matrix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Markdown tip: you should not leave extra enters, just what' s needed

@@ -17,6 +17,11 @@ Note: The [MBI5168](http://archive.fairchip.com/pdf/MACROBLOCK/MBI5168.pdf) is a

The [MBI5027 sample](samples/README.md) demonstrates how to use the shift register. The [generic shift register sample](../ShiftRegister/samples/README.md) is more extensive and is compatible with the MBI5027.

## Documentation

- Datasheet: http://archive.fairchip.com/pdf/MACROBLOCK/MBI5027.pdf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't mark them all but would be perfect if you can adjust those raw URL with the correct pattern.

Markdown tip: In case you really want to show an URL, it should then be contained into < >


The sample is based on following resources:

- [Analog Inputs for Raspberry Pi Using the MCP3008](https://learn.adafruit.com/reading-a-analog-in-and-controlling-audio-volume-with-the-raspberry-pi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is a great way to have the enumeration and the links on documentations.


The Raspberry Pi has support for SPI. You need to [enable the SPI interface on the Raspberry Pi](https://www.raspberrypi-spy.co.uk/2014/08/enabling-the-spi-interface-on-the-raspberry-pi/) since it is not enabled by default.

You can use the following code to [access the MCP3008 via hardware SPI](Mcp3008.Sample.cs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong URL, should be samples/Mcp3008.Sample.cs

Note: double check the file name, links are case sensitive in theory


You can also access the MCP3008 via GPIO pins, implementing SPI manually. This method is referred to as [bit-banging](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Example_of_bit-banging_the_master_protocol).

You can use the following code to [access the MCP3008 via GPIO](Mcp3008.Sample.cs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong url as well should be amples/Mcp3008.Sample.cs


The chip is 10-bit, which means that it will generate values from 0-1023 (recall that 2^10 is 1024). We can transform the value to a more familiar 0-100 scale by dividing the 10-bit value by 10.24.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tooooo many enters ;-)

Note: I'll not point them all

@krwq
Copy link
Member Author

krwq commented Aug 2, 2021

the changes from @Ellerbach LGTM, can't approve since I'm the author of the PR

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge

@Ellerbach Ellerbach merged commit 148fc42 into dotnet:main Aug 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants