Sophie
unread,Dec 5, 2009, 6:27:35 PM12/5/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ruby-arduino...@googlegroups.com
OK, I added a dummy integer addition, and the type hint seemed to work.
def short_long(pin, ms)
1 + pin
blink pin, ms
blink pin, 2*ms
end
On Dec 5, 2009, at 5:03 PM, Sophie wrote:
> I tried this:
>
> class Hello2 < ArduinoSketch
>
> output_pin 13, :as => :led
>
> def short_long(pin, ms)
> blink pin, ms
> blink pin, 2 * ms
> end
>
> def loop
> short_long (led, 30)
> end
>
> end
>
> And I get
> hello2.cpp:122: error: initializing argument 1 of 'void
> short_long(void*, long int)'
> make: *** [hello2.elf] Error 1
>
> Somewhere Rad or ruby2C it is defaulting to void* parameter types.
> Can I tell it otherwise?
>
> How do I factor my Ruby methods using parameters?
>
> Thanks!