Subject:
|
Re: I2C interface
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 13 May 2003 20:13:51 GMT
|
Viewed:
|
1344 times
|
| |
| |
Thanks for your answer! However, I do have some questions about it..
First of all, I looked at the code you send in your post. looks nice, but to be
honest, I don't know anything about assembly ( It is assembly, whats being used
in the sub set_motor, right?)
Anyways, i first wanted to give it a try, before wondering how it works. But it
doesn't work! When I compile my program, it says there are some undefined
references to sub_motor(unsigned char,unsigned char). So i started looking for
assembly docs, and especially docs which describe how to use assembly in C++. I
did learn some about assembly, but nothing about using it in C++.
So my question is: does anyone now some docs/tutorials which can get me
starting whit using assembly code in c++?? Becasue I do want to know how this
piece of code works(and why I can't get it to work (-: )
-thanks alot,
bas.
|
|
Message has 1 Reply: | | Re: I2C interface
|
| Hi, Change the declaration for set_motor to: extern "C" void set_motor(unsigned char mask, unsigned char value); and you should be fine. And, yes, it's H8 asm code. Probably could have written it in C, but I tend to prefer asm for low-level type (...) (22 years ago, 13-May-03, to lugnet.robotics)
|
Message is in Reply To:
| | Re: I2C interface
|
| Hi Bastiaan, BrickOS only updates the motor register once every millisecond, so when using functions like motor_a_dir(), the highest frequency you can generate is 500 Hz. You can get around this by patching the kernel, or if that seems disagreeable, (...) (22 years ago, 12-May-03, to lugnet.robotics)
|
4 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|