background image

 

 

Tap the following command 

sudo grove_pwm_buzzer

 in the command line interface. 

 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
10 
11

 

pi

@raspberrypi

:~

$

 sudo grove_pwm_buzzer 

Insert Grove-Buzzer to Grove-Base-Hat slot PWM[

12

 

13

 VCC GND] 

 

3800

 

3400

 

3000

 

2900

 

2550

 

2270

 

2000

 

exiting application 

 

The buzzer will ring a few times and then stop, the program will automatically exit. 

Digital Port

 

We will take the 

Grove - Ultrasonic Ranger

 for example to introduce the Digital port. 

Hardware connection diagram

 

 

Tap the following command 

grove_ultrasonic_ranger 5 6

 in the command line interface. 

 1 
 2 
 3 
 4 
 5 
 6 

pi

@raspberrypi

:~

$

 grove_ultrasonic_ranger 

5

 

6

 

Detecting distance... 

6.979909436456088

 cm 

7.966469074117726

 cm 

12.451204760321255

 cm 

15.184797089675378

 cm 

Содержание Grove Base Hat

Страница 1: ...ng you the Grove Base Hat for Raspberry Pi and Grove Base Hat for Raspberry Pi Zero in another word we bring the Raspberry Pi the whole Grove System The Grove Base Hat for Raspberry Pi provide Digital Analog I2C PWM UART port to meet all your needs With the help of build in MCU a 12 bit 8 channel ADC is also available for Raspberry Pi Frankly speaking it s about 60 Grove modules support the Grove ...

Страница 2: ...PWM 1UART Raspberry pi communication bus I2C I2C Address 0x04 Attention The operating voltage is 3 3V please do not input more than 3 3V otherwise it may damage the Raspberry Pi Moreover this hat can not work with 5V grove module via grove port please use 3 3V compatible Grove module Hardware Overview Pin Out Overview ...

Страница 3: ...s the Grove port is the BCM pin number The difference between BCM pins and the physical pins please refer to here 1 Compared with hardware PWM the software PWM isn t so accurate and will have trouble at high frequencies 2 The GPIO BCM pin18 is also marked as PWM0 actually the GPIO BCM 12 and the GPIO BCM 18 share the same PWM channel so they can t set to different rate 3 The audio jack output also...

Страница 4: ...ot messages from the serial console enabled by default It can also be used as a way to interface an Arduino bootloaded ATmega ESP8266 etc with your Pi Digital There are 6 digital Grove sockets in this board normally the yellow wire which connect to the top pin of the 4 pins Grove socket as of Grove cable is the signal wire so we name the digital Grove port D5 D16 D18 D22 D24 D26 ...

Страница 5: ...one but four analog Grove sockets are available The analog sensor inputs the analog voltage into the 12 bit ADC After the ADC convert the analog data to digital data it input the digital data to the Raspberry Pi through the I2C interface I2C There are three I2C port available in this board they all connect to the I2C pin of the raspberry directly You can consider this part as an I2C hub Most of se...

Страница 6: ...Raspberry Pi into the Raspberry Pi Step 2 Plug the Grove module into the corresponding Grove port Step 3 Power the Raspberry Pi with micro usb cable Warning We recommend that you power up the Raspberry Pis after all the hardware connections are complete Please do not hot plug the sensor module otherwise the Raspberry Pi may crash Software In this section we will introduce how to install the seeed ...

Страница 7: ...om Seeed Studio grove py raw master install sh sudo bash s Success if everything goes well you will see the following notice 1 2 3 4 Successfully installed grove py 0 5 Lastest Grove py from github install complete Step by step installation Besides the one click installation you can also install all the dependencies and latest grove py step by step Please refer to our github page for more informat...

Страница 8: ...nsor_v1_3 grove_lcd_1 2inches grove_oled_display_128x64 grove_servo grove_tilt_switch grove_button grove_led grove_piezo_vibration_sensor grove_slide_potentiometer grove_touch_sensor grove_collision_sensor grove_light_sensor_v1_2 grove_pwm_buzzer grove_sound_sensor grove_ultrasonic_ranger grove_gesture_sensor grove_loudness_sensor grove_recorder_v3_0 grove_switch grove_water_sensor grove_high_accu...

Страница 9: ...on The buzzer will ring a few times and then stop the program will automatically exit Digital Port We will take the Grove Ultrasonic Ranger for example to introduce the Digital port Hardware connection diagram Tap the following command grove_ultrasonic_ranger 5 6 in the command line interface 1 2 3 4 5 6 pi raspberrypi grove_ultrasonic_ranger 5 6 Detecting distance 6 979909436456088 cm 7 966469074...

Страница 10: ...he target object the measurment value will change accordingly Press Ctrl C to quit Attention For most grove module you need to add the pin number parameter like grove_ultrasonic_ranger 5 6 5 and 6 are the GPIO BCM pin However you may have noticed that in the first example grove_pwm_buzzer we didn t add a parameter after the command This is because the PWM port and I2C port do not require pin numbe...

Страница 11: ...ry_point grove py 0 5 console_scripts grove_air_quality_sensor_v1_3 File usr local lib python3 5 dist packages grove grove_air_quality_sensor_v1_3 py line 68 in main time sleep 1 KeyboardInterrupt You can use this sensor to detect the air quality Press Ctrl C to quit Notice You may have noticed that for the analog port the silkscreen pin number is something like A1 A0 however in the command we use...

Страница 12: ...ou check your oled Note If you use the I2C tool to scan the I2C address of the grove module you may find two or more address 0x04 is the adrress of the Grove Base Hat for Raspberry Pi Resources Zip Grove Base Hat for Raspberry Pi Eagle Files Zip Seeed Grove py Library Zip Firmware PDF STM32 Datasheet Tech Support Please do not hesitate to submit the issue into our forum http wiki seeedstudio com G...

Отзывы: