Search the Community
Showing results for tags 'wiringpi'.
Found 3 results
-
Hi, I am following the URL below to start up SPI with WiringPi library. I can see spidev in /dev on my TinkerBoard2S. Therefore, I believe the spi settings are reflected at boot time. linaro@linaro-alip:~/Desktop/CSampleCode/spiSpeed$ ls /dev/spidev* /dev/spidev1.0 /dev/spidev5.0 When I run the sample code, I get an error "Unble to open SPI device". Can you please tell me the cause and countermeasure? linaro@linaro-alip:~$ cd /home/linaro/Desktop/CSampleCode/spiSpeed/ linaro@linaro-alip:~/Desktop/CSampleCode/spiSpeed$ sudo ./spiSpeed +-------+--------+----------+----------+-----------+------------+ | MHz | Size | mS/Trans | TpS | Mb/Sec | Latency mS | +-------+--------+----------+----------+-----------+------------+ Unable to open SPI device: No such file or directory Board:TinkerBoard2S Linux version:4.4.194 Best regards,
-
Hello, As the ASUS Tinker Board has so many wonderful features and direct access of lower level peripherals, I've decided to migrate my development from raspberry Pi to Tinker board. Right now, I'm starting with a basic UART code which sends and receive some strings serially but unfortunately it is not working as expected. The UART I'm trying to use UART1 (Pin number 8 and 10). Right now, if (serialDataAvail(fd)) is getting true every single time. After reading the data serialGetchar(fd), I found out that, the RX pin is in low state (receiving 255 continuously). Although, my code has no error, but I'll still add it here. #include <stdio.h> #include <string.h> #include <errno.h> #include <wiringPi.h> #include <wiringSerial.h> int main () { int fd,inCount = 0 ; char inBuff[500],OutBuff[500]; if (wiringPiSetup () == -1) { fprintf (stdout, "Unable to start wiringPi: %s\n", strerror (errno)) ; return 1 ; } else printf("wiringPi: init successfull! \n\r"); if((fd = serialOpen ("/dev/ttyS0", 115200)) < 0) { fprintf (stderr, "Unable to open serial device: %s\n", strerror (errno)) ; return 1 ; } else printf("Serila: /dev/ttyS0 successfully opened! \n\r"); while (1) { if (serialDataAvail(fd)) { inBuff[inCount] = serialGetchar(fd); if ( inBuff[inCount] == '\n') { printf("RX String=%s"); memset(inBuff,'\0',inCount); inCount = 0 ; } inCount++; if ( inCount == 500) { inCount = 0; memset(inBuff,'\0',inCount); } } } } The reply of "dmesg | grep tty" is attached below.
-
Hi, I want to use wiringPi on Tinker2S. I'm trying to use GPIO Pin#15 (wiring Pi Pin#3) as a pull-down input, but after a bit of research, it seems to be acting like it's latching. Once the Input goes High, the input does not drop to Low after that. Is there a good solution?