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

C SDK - 4.1.10. hardware_i2c - Example output incorrect #34

Closed
rbirkby opened this issue Jan 30, 2021 · 4 comments · Fixed by raspberrypi/pico-examples#464
Closed

C SDK - 4.1.10. hardware_i2c - Example output incorrect #34

rbirkby opened this issue Jan 30, 2021 · 4 comments · Fixed by raspberrypi/pico-examples#464
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@rbirkby
Copy link

rbirkby commented Jan 30, 2021

raspberry-pi-pico-c-sdk.pdf section 4.1.10. hardware_i2c says:

   4 // I2C Bus Scan
   5 //  0 1 2 3 4 5 6 7 8 9 A B C D E F
   6 // 0
   7 // 1    @
   8 // 2
   9 // 3        @
  10 // 4
  11 // 5
  12 // 6
  13 // 7
  14 //
  15 // E.g. if slave addresses 0x12 and 0x34 were acknowledged.

This is incorrect. Actual output of the sample code is formatted differently. The vertical axis shows all significant digits of the hex value and empty cells are represented with a period (.) as shown below taken from actual output:

// I2C Bus Scan
//    0 1 2 3 4 5 6 7 8 9 A B C D E F
// 00 . . . . . . . . . . . . . . . .
// 10 . . . . . . . . . . . . . . . .
// 20 . . . . . . . . . . . . . . . .
// 30 . . . . . . . . . . . . . . . .
// 40 . . . . . . . . . . . . . . . .
// 50 . . . . . . . . . . @ . . . . .
// 60 . . . . . . . . . . . . . . . .
// 70 . . . . . . . . . . . . . . . .
// Done.
@aallan aallan added the documentation Improvements or additions to documentation label Feb 1, 2021
@aallan aallan added the waiting for internal comment Waiting for comment from a Raspberry Pi engineer label Feb 1, 2021
@kilograham kilograham removed their assignment Feb 1, 2021
@lurch
Copy link
Contributor

lurch commented Feb 17, 2021

It's possible that the comment was written during an earlier version of the code, and then the code was later updated without the comment being updated to match 😉 I'll check and update the comment as appropriate.
It looks like https://github.com/raspberrypi/pico-examples/blob/master/i2c/bus_scan/bus_scan.c is the ultimate "upstream version" of that code.

@lurch lurch self-assigned this Feb 17, 2021
@lurch lurch removed the waiting for internal comment Waiting for comment from a Raspberry Pi engineer label Feb 17, 2021
@aallan
Copy link
Contributor

aallan commented May 25, 2021

@lurch Did the code get updated?

@aallan aallan added the idle No activity on Issue, will close after 7 days unless a reply is recieved. label May 25, 2021
@lurch
Copy link
Contributor

lurch commented May 25, 2021

Nope, not yet. Still in backlog.

@aallan aallan removed the idle No activity on Issue, will close after 7 days unless a reply is recieved. label Jun 4, 2021
nathan-contino added a commit to nathan-contino/pico-examples that referenced this issue Jan 18, 2024
@aallan
Copy link
Contributor

aallan commented Jan 18, 2024

PR opened raspberrypi/pico-examples#464

@aallan aallan closed this as completed Jan 18, 2024
peterharperuk pushed a commit to raspberrypi/pico-examples that referenced this issue Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants