Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:c72f6ddb0ab7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Apr 25 15:11:12 2017 +0000
@@ -0,0 +1,107 @@
+#include "mbed.h"
+#include "max7219.h" //libreria
+#include "visual.h"
+
+ int main()
+{
+ max7219_configuration_t cfg = {
+ .device_number = 1,
+ .decode_mode = 0, //configuracion del max7219
+ .intensity = Max7219::MAX7219_INTENSITY_5,
+ .scan_limit = Max7219::MAX7219_SCAN_8
+ };
+
+ pantalla.init_device(cfg);
+ pantalla.enable_device(1);
+ pantalla.set_display_test(); //testeo de la matriz
+ wait(1);
+ pantalla.clear_display_test();
+
+ mipwm.period_ms(20);
+
+ char v;
+ while(1){
+ if (pc.readable()){
+ v=pc.getc();
+ if (v=='<')
+
+ pc.printf("Hello World\n");
+ pc.putc(pc.getc());
+ }
+}
+
+
+
+
+
+
+ while(1){
+ Print_pantalla_tabla(m1up);
+ wait(1);
+ Print_pantalla_tabla(m1left);
+ wait(1); //ciclo de visualizaciòn
+ Print_pantalla_tabla(m1right);
+ wait(1);
+ Print_pantalla_tabla(m2up);
+ wait(1);
+ Print_pantalla_tabla(m2left);
+ wait(1);
+ Print_pantalla_tabla(m2right);
+ wait(1);
+ Print_pantalla_tabla(m3up);
+ wait(1);
+ Print_pantalla_tabla(m3left);
+ wait(1); //ciclo de visualizaciòn
+ Print_pantalla_tabla(m3right);
+ wait(1);
+ Print_pantalla_tabla(m4up);
+ wait(1);
+ Print_pantalla_tabla(m4left);
+ wait(1);
+ Print_pantalla_tabla(m4right);
+ wait(1);
+
+
+
+ mipwm.pulsewidth_us(2500);
+ wait(1);
+ mipwm.pulsewidth_us(1400);
+ wait(1);
+ mipwm.pulsewidth_us(600);
+ wait(1);
+
+
+ mipwm2.pulsewidth_us(2500);
+ wait(1);
+ mipwm2.pulsewidth_us(1400);
+ wait(1);
+ mipwm2.pulsewidth_us(600);
+ wait(1);
+
+
+ mipwm3.pulsewidth_us(2500);
+ wait(1);
+ mipwm3.pulsewidth_us(1400);
+ wait(1);
+ mipwm3.pulsewidth_us(600);
+ wait(1);
+
+
+
+
+ }
+
+}
+
+
+void Print_pantalla_tabla(unsigned char *pValor){
+ int i; //funcion de puntero, impresión de pantalla
+ for (i =0;i<8;i++)
+ pantalla.write_digit(1,i+1,pValor[i]);
+
+}
+
+
+
+
+