milkv-duo / duo-examples Goto Github PK
View Code? Open in Web Editor NEWMilk-V Duo official C/C++ examples
Milk-V Duo official C/C++ examples
Hi guys. I am trying to detect button actions with a GPIO pin and a GND pin at milk-v DUO.
I connected the GPIO14 pin and the button to the GND pin. In the program, I set the GPIO14 in an input mode and read digital value per second, which worked for Raspberry Pi 4b GPIO. However when I closed the switch, it seemed to short-circuit, and the Milkv automatically restarted. I googled it and found it seems I need a resistance between the switch and the two pins. I managed to add a 150Ω resistance but the GPIO14 can not read the switch closing this time.
I am a newbie in embedded development. If there are any mistakes in what I did above, or if you have better suggestions, I would be happy to accept them. Thank you in advance.
The code:
#include <stdio.h>
#include <unistd.h>
#include <wiringx.h>
#define GPIO_14 19
int main() {
if(wiringXSetup("duo", NULL) == -1) {
wiringXGC();
return -1;
}
if(wiringXValidGPIO(GPIO_14) != 0) {
printf("Invalid GPIO %d\n", GPIO_14);
return -1;
}
pinMode(GPIO_14, PINMODE_INPUT);
while(1) {
int ret;
ret = digitalRead(GPIO_14);
printf("value: %d\n", ret); // should print 0 if I close the switch or press the button?
sleep(1);
}
return 0;
}
Is there currently a way to utilize the 8051 Subsystem of the board? I think i have not yet found anything in the milkv-duo repositories regarding this functionality.
Could it be possible to access the subsystem using a modified version of the mailbox test, or is there currently no rather simle way to utilize the subsystem?
[root@milkv-duo]# ls# ./ssd1306_i2c
helloworld ssd1306_i2c
[root@milkv-duo]
-sh: ./ssd1306_i2c: not found
i dont know why it is saying it is not there when it clearly is there in the directory.
Hello, I tried compiling examples with the SDK which envsetup.sh
downloads, and no luck — because it's made for x86_64.
Where can I get a version for ARM machines, or maybe I can get somewhere your SDK source and compile it to work on ARM?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.