I am using Freedom Studio with a HiFive1 rev b. I would like to build a simple program that blinks an LED on a solderless breadboard. Is there any way for me to interface with pins 1-19 like an Arduino?
Arduino provides simple commands like
pinMode(2,INPUT);
digitalWrite(0, HIGH);
Of course, given the fact that as of the latest release of the HiFive board, there is no way to run Arduino code directly on the board directly, I don’t expect this to be simple, especially since this product is new. I am wondering, however, if it can be done. How simple is it in C vs Rust? Any help would be appreciated.
I don’t know about the Freedom Studio but you want to accomplish is surely possible there. Another possibility would be to use the Snowfox framework where accessing GPIO pins can be done quite simple in a high-level way quite similar to Arduino.
As for getting the number of a specific pin exposed on the HiFive 1 Rev. B header - you can look up the exact GPIO number by taking a look at the schematic / page 3. It would be an easy thing to create a header file containing constants for each GPIO pin exposed on a header, e.g.
It’s interesting. I actually imported these as source files in scifive to see if the libraries would work in the IDE. The only problem seems to be that the code above is written in c++ rather than C. Does snowfox support C? I think that’s all I would need. Granted, I haven’t tried it the way you suggested. I’m not complainin, I’m just curious.
Hi Jonas You’ll be definitely able to integrate Snowfox code within the Freedom SDK / Studio (and compile them) but I doubt it’s the wisest course of action. Both Freedom SDK and Snowfox provide HAL (Hardware Abstraction Layer) functionality but each of those projects is self-contained and follows its own design philosophy. Wildly mixing together without knowing what you are doing is a guarantee for a headache
I can understand your reluctance to deviate from GUI tools because I myself like to work with a good GUI when its available. Fortunately the HiFive 1 Rev. B is supported by Segger Ozone which is one of the best debugging IDEs that’s around. In order to get started you have to: