kopia lustrzana https://github.com/jbruce12000/kiln-controller
				
				
				
			adding board id to output
							rodzic
							
								
									375a725480
								
							
						
					
					
						commit
						2896b87b97
					
				|  | @ -5,9 +5,15 @@ import digitalio | |||
| import time | ||||
| import datetime | ||||
| 
 | ||||
| try: | ||||
|     import board | ||||
| except NotImplementedError: | ||||
|     print("not running on Raspberry PI, assuming simulation") | ||||
| 
 | ||||
| 
 | ||||
| ######################################################################## | ||||
| # | ||||
| # To test your output... | ||||
| # To test your gpio output to control a relay... | ||||
| # | ||||
| # Edit config.py and set the following in that file to match your | ||||
| # hardware setup: GPIO_HEAT | ||||
|  | @ -18,12 +24,15 @@ import datetime | |||
| # | ||||
| # This will switch the output on for five seconds and then off for five  | ||||
| # seconds. Measure the voltage between the output and any ground pin. | ||||
| # You can also run ./gpioreadall.py in another window to see the voltage | ||||
| # on your configured pin change. | ||||
| ######################################################################## | ||||
| 
 | ||||
| heater = digitalio.DigitalInOut(config.gpio_heat) | ||||
| heater.direction = digitalio.Direction.OUTPUT | ||||
| 
 | ||||
| print("\nheater configured as config.gpio_heat = %s BCM pin\n" % (config.gpio_heat)) | ||||
| print("\nboard: %s" % (board.board_id)) | ||||
| print("heater configured as config.gpio_heat = %s BCM pin\n" % (config.gpio_heat)) | ||||
| 
 | ||||
| while True: | ||||
|     heater.value = True | ||||
|  |  | |||
|  | @ -6,6 +6,12 @@ import time | |||
| import datetime | ||||
| import busio | ||||
| 
 | ||||
| try: | ||||
|     import board | ||||
| except NotImplementedError: | ||||
|     print("not running on Raspberry PI, assuming simulation") | ||||
| 
 | ||||
| 
 | ||||
| ######################################################################## | ||||
| # | ||||
| # To test your thermocouple... | ||||
|  | @ -26,11 +32,12 @@ spi = busio.SPI(config.spi_sclk, config.spi_mosi, config.spi_miso) | |||
| cs = DigitalInOut(config.spi_cs) | ||||
| sensor = adafruit_max31855.MAX31855(spi, cs) | ||||
| 
 | ||||
| print("\nSPI configured as:\n") | ||||
| print("    config.spi_sclk = %s BCM pin" % (config.spi_sclk)); | ||||
| print("    config.spi_mosi = %s BCM pin" % (config.spi_mosi)); | ||||
| print("    config.spi_miso = %s BCM pin" % (config.spi_miso)); | ||||
| print("    config.spi_cs   = %s BCM pin\n" % (config.spi_cs)); | ||||
| print("\nboard: %s" % (board.board_id)) | ||||
| print("SPI configured as:\n") | ||||
| print("    config.spi_sclk = %s BCM pin" % (config.spi_sclk)) | ||||
| print("    config.spi_mosi = %s BCM pin" % (config.spi_mosi)) | ||||
| print("    config.spi_miso = %s BCM pin" % (config.spi_miso)) | ||||
| print("    config.spi_cs   = %s BCM pin\n" % (config.spi_cs)) | ||||
| 
 | ||||
| while(True): | ||||
|    time.sleep(1) | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 jbruce
						jbruce