# Using Ruby to generate AVR C-code

**URL:** <https://www.ruby-forum.com/t/using-ruby-to-generate-avr-c-code/110239>\
**Category:** Ruby\
**Created:** [July 24, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/using-ruby-to-generate-avr-c-code/110239 "2007-07-24T15:46:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_WattengSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ed655f/32.png) [@Christian\_WattengSS](https://www.ruby-forum.com/u/Christian_WattengSS)\
**Post date:** [July 24, 2007, 3:46pm UTC](https://www.ruby-forum.com/t/using-ruby-to-generate-avr-c-code/110239/1 "2007-07-24T15:46:52Z")

</div>

I found a message on the net,  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/65582](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/65582)  
that talks about generating c-code and asm-code for AVR  
microcontrollers.

However, this is the only I have ever seen of it. How does he do the  
conversion? Could you make ruby methods like “flashled(port)” and  
“toggleled(port)” that executes C/ASM code using inline? How would the  
C/ASM generation work?

🙂

Lots of questions, I know. But doing low and midlevel coding in C/ASM  
and highlevel and flow in Ruby sounds delicious 🙂

Christian W.
