(Arduino) Fibonacci con Rich Shield de OPEN-SMART

Hola en este tutorial, muestro un código, que he estado experimentando con la placa Rich Shield de OPEN-SMART, sin lugar a dudas una buena compra, lo podéis comprar aquí, sin más voy a hablar qué me ha parecido esta maravilla, me parece increíble que en una placa tan barata, se pueda hacer tantas cosas, teniendo cuenta que el Arduino + placa no sale más de $12, la verdad un precio bastante bueno, para la de cosas que se puede hacer con él.

Lo que le falta a la placa, y la verdad al precio que tiene es difícil de conseguir es que se pudieran poner más módulos aparte de la placa, eso sería increíble, y la verdad sería impresionante, aún no me puedo creer que haya tanta potencia en una placa tan chica.

Tabla de contenidos

Materiales:

Rich Shield de OPEN SMART AliExpress.com Product – Starter kit Rich Shield with Infrared Receiver LED Buzzer Button DHT11 Light Sensor Temperature Sensor Module for Arduino UNO R3
Arduino UNO AliExpress.com Product – high quality One set UNO R3 (CH340G) MEGA328P for Arduino UNO R3 (NO USB CABLE)

Código:

Aquí les dejo el código, espero que lo disfrutéis, experimentéis y me comentéis.

/************************************************* *************************************************
* OPEN-SMART Rich Shield Lesson 3:  Light Sensor
* You can learn how to know the ambient light is dark or bright.  And display illuminance on the digital tube.
*
* The following functions are available:
*
* lightsensor.getRes();//it return the resistance of the light sensor, the darker the ambient light, the larger the resistance.
*
************************************************** ************************************************** *****/
#include <math.h>
#include <Wire.h>

#include «RichShieldLightSensor.h»
#include «RichShieldTM1637.h»

#define CLK 10//CLK of the TM1637 IC connect to D10 of OPEN-SMART UNO R3
#define DIO 11//DIO of the TM1637 IC connect to D11 of OPEN-SMART UNO R3
TM1637 disp(CLK,DIO);

#define LIGHTSENSOR_PIN A2//SIG pin of Rocker Switch module connect to A0 of IO Shield, that is pin A2 of OPEN-SMART UNO R3
LightSensor lightsensor(LIGHTSENSOR_PIN);


String str=»»;
int tope=700;
int a=0;
int b=1;
int c, i;
void setup() {
  Serial.begin(9600); //Set baud rate of serial port to be 9600bps, burn the program and open the serial monitor
                     //on the upper right corner of Arduino IDE to check the sensor data.
  disp.init();//The initialization of the display

}
void loop() {
      a=0;
      b=1;
 
  for(i=0;b<tope;i++){

      c = a + b;
      a = b;
      b = c;
  delay(1000);
  disp.display(b);//
  }

Aquí lo podéis comprar:

http://s.click.aliexpress.com/e/JK4XhdA

Deja un comentario

Información básica sobre protección de datos Ver más

  • Responsable: Tomas Gonzalez.
  • Finalidad:  Moderar los comentarios.
  • Legitimación:  Por consentimiento del interesado.
  • Destinatarios y encargados de tratamiento:  No se ceden o comunican datos a terceros para prestar este servicio.
  • Derechos: Acceder, rectificar y suprimir los datos.
  • Información Adicional: Puede consultar la información detallada en la Política de Privacidad.

error: Content is protected !!

Descubre más desde InfoGonzalez - Blog de formador e informático

Suscríbete ahora para seguir leyendo y obtener acceso al archivo completo.

Seguir leyendo

Este sitio web utiliza cookies, si necesitas más información puedes visitar nuestra política de privacidad    Ver
Privacidad
Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.