Page 258 - MDP2022-2
P. 258
id = "unknown"
cv2.putText(img, str(id), (x+5,y-5), font, 1, (255,255,255), 2)
cv2.putText(img, str(confidence), (x+5,y+h-5), font, 1, (255,255,0), 1)
cv2.imshow('camera',img)
k = cv2.waitKey(10) & 0xff
if k == 27:
break
print("\n exit program")
cam.release()
cv2.destroyAllWindows()
0
[아두이노 무게 감지 센서 코드]
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
int led = 7;
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}
long sensor;
void loop() {
sensor = digitalRead(10);
if (sensor == 1) {