EasyManuals Logo

Freenove 4WD Smart Car Board for Raspberry Pi User Manual

Default Icon
132 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #74 background imageLoading...
Page #74 background image
Need support? support.freenove.com
70
Chapter 3 Module test (necessary)
Result:
All LEDs will be turned on for 3 seconds, and colors from LED0 to LED7 are: red, orange, yellow, green, cyan,
blue, purple, and white. You can end the program ahead of time by pressing "ctrl+c".
If the LED color display order is not correct, open the "Led.py" file in the current directory and modify the
value of the "self.ORDER" variable on line 15.
The code of test.py is as below:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import time
try:
from Led import *
led=Led()
def test_Led():
try:
led.ledIndex(0x01,255,0,0) #Red
led.ledIndex(0x02,255,125,0) #orange
led.ledIndex(0x04,255,255,0) #yellow
led.ledIndex(0x08,0,255,0) #green
led.ledIndex(0x10,0,255,255) #cyan-blue
led.ledIndex(0x20,0,0,255) #blue
led.ledIndex(0x40,128,0,128) #purple
led.ledIndex(0x80,255,255,255) #white
print "The LED has been lit, the color is red orange yellow green cyan-blue blue
white"
time.sleep(3) #wait 3s
led.colorWipe(led.strip, Color(0,0,0)) #turn off the light
print "\nEnd of program"
except KeyboardInterrupt:
led.colorWipe(led.strip, Color(0,0,0)) #turn off the light
print "\nEnd of program"
except:
pass

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Freenove 4WD Smart Car Board for Raspberry Pi and is the answer not in the manual?

Freenove 4WD Smart Car Board for Raspberry Pi Specifications

General IconGeneral
BrandFreenove
Model4WD Smart Car Board for Raspberry Pi
CategoryMicrocontrollers
LanguageEnglish