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

Chapter 12 Footstep Detector - Minor Fix for Serial Comm #13

Closed
TheEJM3 opened this issue Jan 1, 2016 · 2 comments
Closed

Chapter 12 Footstep Detector - Minor Fix for Serial Comm #13

TheEJM3 opened this issue Jan 1, 2016 · 2 comments

Comments

@TheEJM3
Copy link

TheEJM3 commented Jan 1, 2016

This isn't really a fix, just an alternative for terminals to read the serial data as ASCII instead of bytes:

Original code:
transmitByte(adcValue - 512 + 127);
transmitByte((lowValue >> 4) - 512 + 127);
transmitByte((highValue >> 4) - 512 + 127);
_delay_ms(CYCLE_DELAY);

Replace with:
printByte(adcValue - 512 + 127);
printString(" - ");
printByte((lowValue >> 4) - 512 + 127);
printString(" - ");
printByte((highValue >> 4) - 512 + 127);
printString("\r\n");
_delay_ms(CYCLE_DELAY);

The serial comm will look like this afterward:
124 - 124 - 125
124 - 124 - 125
124 - 124 - 125
124 - 124 - 125
...

Hope this helps!

-TheEJM3

@TheEJM3
Copy link
Author

TheEJM3 commented Jan 1, 2016

Forgot to add...

Elliot, great book. I've been learning a ton. I jumped right into learning the Cortex M series and took a step back after finding a lack of structured tutorials. This is a great introduction to embedded system programming in C. Fun and hands on. Thank you.

-TheEJM3

@hexagon5un
Copy link
Owner

That's awesome -- both the fix and that you've used the book to springboard into the ARM chips. Thanks very much for submitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants