/********************************************************************************* * Copyright: (C) 2018 LingYun IoT System Studio * All rights reserved. * * Filename: led.c * Description: This file is used to control RGB 3-colours LED * * pi@raspberrypi:~ $ gpio readall show BCM and wPi pinmap * * LED BCM wPi Phy Pin * G ---- GPIO.13 ---- GPIO.23 ---- #Pin33 * R ---- GPIO.19 ---- GPIO.24 ---- #Pin35 * B ---- GPIO.26 ---- GPIO.25 ---- #Pin37 * I ---- GND ---- * * Version: 1.0.0(2018/10/14) * Author: Guo Wenxue * ChangeLog: 1, Release initial version on "2018/10/14 12:13:26" * ********************************************************************************/ #include #include #include #include #include #include #include #include #include #include "led.h" void init_led(void) { int i; for(i=0; i=LED_MAX ) return -1; if( OFF == cmd ) digitalWrite (led_gpio[which], LOW); else digitalWrite (led_gpio[which], HIGH); return 0; }