Editing Changing SimpleMotion baud rate
Your changes will be displayed to readers once an authorized user accepts them. (help) |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 94: | Line 94: | ||
} | } | ||
− | // | + | //your SimpleMotion application |
int main() | int main() | ||
{ | { | ||
− | smSetDebugOutput(SMDebugMid,stderr); | + | /*in your SM application, the code might follow this kind pattern: */ |
+ | smSetDebugOutput(SMDebugMid,stderr); | ||
− | |||
if( OpenBusWithCustomBaudrate() == smfalse ) | if( OpenBusWithCustomBaudrate() == smfalse ) | ||
{ | { | ||
Line 107: | Line 107: | ||
} | } | ||
− | |||
while(1) | while(1) | ||
{ | { | ||
+ | //do some communication. in this demo we just read SMP_DEVICE_TYPE and check if errors occur: | ||
+ | |||
smint32 deviceType; | smint32 deviceType; | ||
int slaveAddress=enter some address here; | int slaveAddress=enter some address here; | ||
Line 145: | Line 146: | ||
==See also== | ==See also== | ||
*RealTimeControlExample from https://github.com/GraniteDevices/SimpleMotionV2Examples/tree/develop - it is another practical example app that changes baud rate | *RealTimeControlExample from https://github.com/GraniteDevices/SimpleMotionV2Examples/tree/develop - it is another practical example app that changes baud rate | ||
− | |||
− | |||
− | |||
− |