Entradas

Mostrando entradas de mayo, 2019

EJEMPLO DE CÓDIGO DE MATRIZ

CÓDIGO EN ARDUINO BLOCKS BLOG ORIGINAL DEL CÓDIGO #include < SPI . h > #include < Wire . h > #include < Adafruit_GFX . h > #include < Adafruit_LEDBackpack . h > double i ; Adafruit_8x8matrix ledmatrix_1 = Adafruit_8x8matrix ( ) ; double math_random_int ( int a , int b ) {   if ( a > b ) {     int c = a ;     a = b ;     b = c ;   }   return ( double ) random ( a , b + 1 ) ; } static const uint8_t PROGMEM ledmatrix_data_sprite_face_happy [ ] PROGMEM = { B00000000 , B01100110 , B01100110 , B00000000 , B00000000 , B11000011 , B01100110 , B00111100 } ; static const uint8_t PROGMEM ledmatrix_data_sprite_face_sad [ ] PROGMEM = { B00000000 , B01100110 , B00100100 , B00000000 , B00111100 , B01100110 , B11000011 , B10000001 } ; static const uint8_t PROGMEM ledmatrix_data_sprite_face_angry [ ] PROGMEM = { B00000000 , B01000010 , B01100110 ...

POSIBLE CÓDIGO PARA GUANTELETE

#include < EducationShield . h > VUMeter me ; int pins [ ] = { 3 , 5 , 6 , 9 , 10 , 11 } ; int pinCount = 6 ; int ORANGE = 3 ; int RED = 5 ; int BLUE = 6 ; int PURPLE = 9 ; int GREEN = 10 ; int YELLOW = 11 ; void setup ( ) { me . config ( pinCount , pins ) ; me . begin ( ) ; // put your setup code here, to run once: } void loop ( ) {   for ( int i = 0 ; i <= 255 ; i ++ ) {     analogWrite ( ORANGE , i ) ;     delay ( 10 ) ; } for ( int i = 0 ; i <= 255 ; i ++ ) {     analogWrite ( RED , i ) ;     delay ( 10 ) ; }     for ( int i = 0 ; i <= 255 ; i ++ ) {     analogWrite ( BLUE , i ) ;     delay ( 10 ) ; }     for ( int i = 0 ; i <= 255 ; i ++ ) {     analogWrite ( PURPLE , i ) ;     delay ( 10 )...