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

Backwards compatibility #23

Open
Adman opened this issue Feb 19, 2016 · 1 comment
Open

Backwards compatibility #23

Adman opened this issue Feb 19, 2016 · 1 comment

Comments

@Adman
Copy link
Member

Adman commented Feb 19, 2016

@vargac I've got a couple of issues for you.

Why does print function take only char?
How to define baudrate?
And how should I rewrite vic_tasks_run?


Kompot.ino: In function ‘void show_battery_voltage()’:
Kompot.ino:192:36: error: cannot convert ‘double’ to ‘const char*’ for argument ‘1’ to ‘void vic_print(const char*)’
     vic_print(get_battery_voltage());
                                    ^
In file included from Kompot.ino:80:0:
Kompot.ino: In function ‘void camera_data()’:
..//libraries/vic/vic.h:80:40: error: invalid conversion from ‘char’ to ‘const char*’ [-fpermissive]
 #define vic_println(s) do { vic_print(s); vic_out('\n'); } while(0)
                                        ^
Kompot.ino:214:5: note: in expansion of macro ‘vic_println’
     vic_println(pixy_action);
     ^
..//libraries/vic/vic.h:83:6: error:   initializing argument 1 of ‘void vic_print(const char*)’ [-fpermissive]
 void vic_print(const char *s);
      ^
Kompot.ino: In function ‘void setup()’:
Kompot.ino:241:29: error: ‘VIC_SERIAL0’ was not declared in this scope
     vic_init_serial(115200, VIC_SERIAL0);
                             ^
Kompot.ino:241:40: error: ‘vic_init_serial’ was not declared in this scope
     vic_init_serial(115200, VIC_SERIAL0);
                                        ^
Kompot.ino: In function ‘void loop()’:
Kompot.ino:330:19: error: ‘vic_tasks_run’ was not declared in this scope
     vic_tasks_run();```
@vargac
Copy link
Member

vargac commented Feb 19, 2016

@Adman I hope I can give you answers
vic_print just prints strings - for simplicity. Serial.prints should be used in arduino project instead. Or if you really want to use vicprints, you can use sprintf and then vic_print.
There is nothing like baudrate now. You just give characters to vic (by vic_process) and vic executes when '\n' is sent. See tests/arduino if you want to read from serial and send it to vic.
Wait, may be it will be in next versions or try to write it on your own.

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