system
January 22, 2011, 6:08pm
1
Hello!
I am trying to add new function "MydigitalWrite" to wiring_digital.c () (\arduino-0017\hardware\cores\arduino)
When I try to compile:
In function 'void loop()':
error: 'MydigitalWrite' was not declared in this scope
How to win this problem?
Hello!
I am trying to add new function "MydigitalWrite" to wiring_digital.c () (\arduino-0017\hardware\cores\arduino)
When I try to compile:
In function 'void loop()':
error: 'MydigitalWrite' was not declared in this scope
How to win this problem?
There should be no reason to modify the core function in the wiring library.
Just write your new function directly following the loop() function in your sketch:
void MydigitalWrite( int argument1, int argument2, etc.)
{
//your new code
// more code
}
Then you can use your new function anywhere in the setup or loop function of your sketch.
Lefty
system
January 22, 2011, 7:22pm
3
there is one reason
standart digitalwrite spends a lot of time to switch on or switch of massive of pins
i think i can do it, if i modify standart digitalWrite
Why do you want to modify digitalWrite? To make it faster?
system
January 22, 2011, 7:48pm
5
No. i want create new to switch on or off massive of pins
i cant use like this
for(int i=0;i<10;i++)
{
digitalWrite(i,HIGH);
}
because it spend a lot of time
system
January 22, 2011, 7:50pm
6
i only need add new function to \arduino-0017\hardware\cores\arduinowiring_digital.c
No. i want create new to switch on or off massive of pins
Have you considered direct port access?
system
January 22, 2011, 8:04pm
8
Yes but i found nothing
How i can do it? there is special function?
system
January 22, 2011, 8:08pm
9
i want to do it like this
out = portOutputRegister(port);
if (val == LOW) *out &= ~bit;
else *out |= bit;
that is why i need to add new function
Yes but i found nothing
http://www.google.com/search?q=arduino+port
How i can do it? there is special function?
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.