Ir ao conteúdo
  • Cadastre-se

laura91

Membro Júnior
  • Posts

    5
  • Cadastrado em

  • Última visita

Reputação

0
  1. @Isadora Ferraz Isadora, então minha programação ficaria assim? Peguei a programação desse link (http://www.fut-electronics.com/wp-content/plugins/fe_downloads/Uploads/Tutorial_for_Load_Cell_weight_sensor 50KG.pdf), estou usando a mesma celula de carga e amplificador porém preciso que os leds acendam. Quando jogo essa programação no Arduino aparece vários erros. Vou procurar aprender sobre programação pois gostei dos projetos que vi com arduino // HX711.DOUT - pin #A1 // HX711.PD_SCK - pin #A0 HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library void setup() { Serial.begin(38400); Serial.println("HX711 Demo"); Serial.println("Before setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight (not set yet) Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight (not set) divided // by the SCALE parameter (not set yet) scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details scale.tare(); // reset the scale to 0 Serial.println("After setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare() Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight, divided // by the SCALE parameter set with set_scale Serial.println("Readings:"); } void loop() { Serial.print("one reading:\t"); Serial.print(scale.get_units(), 1); Serial.print("\t| average:\t"); Serial.println(scale.get_units(10), 1); scale.power_down(); // put the ADC in sleep mode delay(5000); scale.power_up(); } if (peso!=peso_que_eu_quero) {led_vermelho=1;led_verde=0;} else {led_vermelho=0;led_verde=1;}
  2. Bom dia! Isadora, então minha programação ficaria assim? Peguei a programação desse link (http://www.fut-electronics.com/wp-content/plugins/fe_downloads/Uploads/Tutorial_for_Load_Cell_weight_sensor 50KG.pdf), estou usando a mesma celula de carga e amplificador porém preciso que os leds acendam Vou procurar aprender sobre programação pois gostei dos projetos que vi com arduino // HX711.DOUT - pin #A1 // HX711.PD_SCK - pin #A0 HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library void setup() { Serial.begin(38400); Serial.println("HX711 Demo"); Serial.println("Before setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight (not set yet) Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight (not set) divided // by the SCALE parameter (not set yet) scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details scale.tare(); // reset the scale to 0 Serial.println("After setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare() Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight, divided // by the SCALE parameter set with set_scale Serial.println("Readings:"); } void loop() { Serial.print("one reading:\t"); Serial.print(scale.get_units(), 1); Serial.print("\t| average:\t"); Serial.println(scale.get_units(10), 1); scale.power_down(); // put the ADC in sleep mode delay(5000); scale.power_up(); } if (peso!=peso_que_eu_quero) {led_vermelho=1;led_verde=0;} else {led_vermelho=0;led_verde=1;}
  3. Bom dia! Estou com uma programação e preciso alterar para que os leds do meu projeto funcionem de acordo com o que preciso mas sou totalmente leiga em c++, preciso que o led vermelho acenda si o peso der <ou> ou o led verde acenda si o peso estiver =. Segue a programação. #include "HX711.h" // HX711.DOUT - pin #A1 // HX711.PD_SCK - pin #A0 HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library void setup() { Serial.begin(38400); Serial.println("HX711 Demo"); Serial.println("Before setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight (not set yet) Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight (not set) divided // by the SCALE parameter (not set yet) scale.set_scale(2280.f); // this value is obtained by calibrating the scale with known weights; see the README for details scale.tare(); // reset the scale to 0 Serial.println("After setting up the scale:"); Serial.print("read: \t\t"); Serial.println(scale.read()); // print a raw reading from the ADC Serial.print("read average: \t\t"); Serial.println(scale.read_average(20)); // print the average of 20 readings from the ADC Serial.print("get value: \t\t"); Serial.println(scale.get_value(5)); // print the average of 5 readings from the ADC minus the tare weight, set with tare() Serial.print("get units: \t\t"); Serial.println(scale.get_units(5), 1); // print the average of 5 readings from the ADC minus tare weight, divided // by the SCALE parameter set with set_scale Serial.println("Readings:"); } void loop() { Serial.print("one reading:\t"); Serial.print(scale.get_units(), 1); Serial.print("\t| average:\t"); Serial.println(scale.get_units(10), 1); scale.power_down(); // put the ADC in sleep mode delay(5000); scale.power_up(); } Muito obrigada a quem conseguir me ajudar, falta isso para finalizar. O led verde esta ligado na 12 e o vermelho na 13 e o amplificador na a0.
  4. Bom dia! O próximo passo da programação é o If e que estou com muita dificuldade. a célula de carga usada foi essa (https://www.autocorerobotica.com.br/sensor-de-pesocelula-de-carga) e vamos usar um amplificador Hx711 24bits. O si da programação seria para 500ml de água ou seja 500gramas = 0,5kg. Si o peso estiver certo o led2 acende, si o peso estiver abaixo ou acima o led1 acende. Como ficaria essa programação? Si alguém puder me ajudar agradeço, meu protótipo precisa dessa programação para ser testado. Tenho a seguinte programação até o momento (usando o que foi postado no forum), porém não sei si esta correta e como faço o si explicado anteriormente. int led1 = 13; //Declaração de variável. Indica que o led1 está conectado no pino digital 13 do Arduino int led2 = 12; //Declaração de variável. Indica que o led1 está conectado no pino digital 12 do Arduino int celula = A4; //Declaração de variável. Indica que a célula de carga está conectada no pino digital A4 do Arduino long detectionSpanInitial = 0; long detectionSpan = 0; boolean lightState = false; void setup() { //Declaração da função setup().Esta função é chamada apenas uma vez, quando o Arduino é ligado ou reiniciado. pinMode(celula, INPUT); //entrada de dados pinMode(infra, INPUT); //entrada de dados pinMode(led1, OUTPUT); //saída de dados pinMode(led2, OUTPUT); //saída de dados } void loop() { //Declaração da função loop().Após a função setup() ser chamada, a função loop() é chamada repetidamente até o Arduino ser desligado. // Todas as linhas a seguir são chamadas de função com passagem de parâmetros. // As funções são executadas em sequência para fazer o LED acender e apagar. int celula = digitalRead(Sensor); } If
  5. Bom dia! Estou tentando fazer uma programação com os seguintes: Programação de esteira para arduino Led1, led2, sensor infravermelho, celula de carga Esteira para quando sensor detectar objeto Celula pesa o produto Si peso = 50kg led1 acende si peso menor ou maior que 50kg led2 acende Gostaria de saber si estou no caminho certo e si alguem tem uma dica para terminar essa programação, não tenho muito conhecimento e estou com dificuldades. int led1 = 8; //Declaração de variável. Indica que o led1 está conectado no pino digital 13 do Arduino int led2 = 9; //Declaração de variável. Indica que o led1 está conectado no pino digital 13 do Arduino int infra = 0; //Declaração de variável. Indica que o infravermelho está conectado no pino digital 13 do Arduino int celula = 1; //Declaração de variável. Indica que o celula de carga está conectado no pino digital 13 do Arduino long detectionSpanInitial = 0; long detectionSpan = 0; boolean lightState = false; void setup() { //Declaração da função setup().Esta função é chamada apenas uma vez, quando o Arduino é ligado ou reiniciado. pinMode(celula, INPUT); //entrada de dados pinMode(infra, INPUT); //entrada de dados pinMode(led1, OUTPUT); //saida de dados pinMode(led2, OUTPUT); //saida de dados } void loop() { //Declaração da função loop().Após a função setup() ser chamada, a função loop() é chamada repetidamente até o Arduino ser desligado. // Todas as linhas a seguir são chamadas de função com passagem de parâmetros. // As funções são executadas em sequência para fazer o LED acender e apagar.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...