You can Ctrl + C whenever you wish to quit this program as well. :~/grove.py/grove $ python grove_sound_sensor.py 0įile "grove_sound_sensor.py", line 67, in įile "grove_sound_sensor.py", line 64, in main Tap the following command ++python grove_sound_sensor.py 0++ in the command line interface. The default setting of ADC PIN is floating_input. Voltage for each channel:(unit:mv,max=3300mv): Now, if there’s no error, it should look like this! :~/grove.py/grove $ python adc_8chan_12bit.py Print("The default setting of ADC PIN is floating_input.") Print("voltage for each channel:(unit:mv,max=3300mv):") #get all raw adc data,THe max value is 4095,cause it is 12 Bit ADCĭata=_i2c_block_data(self.addr,REG_RAW_DATA_START+i,2)ĭata=_i2c_block_data(self.addr,REG_RAW_DATA_START+n,2)ĭata=_i2c_block_data(self.addr,REG_VOL_START+i,2)ĭata=_i2c_block_data(self.addr,REG_VOL_START+n,2)ĭata=_i2c_block_data(self.addr,REG_RTO_START+i,2)ĭata=_i2c_block_data(self.addr,REG_RTO_START+n,2) import timeĭef _init_(self,bus_num=1,addr=ADC_DEFAULT_IIC_ADDR): The code below is the adc_8chan_12bit.py code. Step 3: Execute the below commands to run the code. Step 2: Install the grove.py library cd grove.py Step 1: Download the source file by cloning the grove.py library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |