Some things are ready

-Fixed Scroll reducer.
-Some functions were broken down into simpler functions, to facilitate the reading of the code.
-The spanish comments were changed to english
-Some variables like cursera or curseraf now they have names that give meaning to what they are.
This commit is contained in:
sancho11
2019-01-25 19:33:03 -06:00
parent d1eac57362
commit 0d3b249c5a
6 changed files with 1338 additions and 1095 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,23 +5,23 @@
* Test your logic analyzer with another arduino * Test your logic analyzer with another arduino
*/ */
#define led A5 #define pin1 A5
#define led2 13 #define pin2 13
void setup() { void setup() {
pinMode(led, OUTPUT); pinMode(pin1, OUTPUT);
pinMode(led2, OUTPUT); pinMode(pin2, OUTPUT);
} }
void loop() { void loop() {
digitalWrite(led, HIGH); digitalWrite(pin1, HIGH);
delayMicroseconds(random(200)); delayMicroseconds(random(200));
digitalWrite(led2, HIGH); digitalWrite(pin2, HIGH);
delayMicroseconds(random(200)); delayMicroseconds(random(200));
digitalWrite(led2, LOW); digitalWrite(pin2, LOW);
delayMicroseconds(random(200)); delayMicroseconds(random(200));
digitalWrite(led, LOW); digitalWrite(pin1, LOW);
delayMicroseconds(random(200)); delayMicroseconds(random(200));
} }

View File

@@ -2,7 +2,6 @@
* ESP8266.ino * ESP8266.ino
* *
* Author : yoursunny * Author : yoursunny
* Led: LED_BUILTIN
*/ */
#include <c_types.h> #include <c_types.h>
@@ -31,7 +30,7 @@ void setup() {
Serial.begin(baudrate); Serial.begin(baudrate);
pinMode(LED_BUILTIN, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH); digitalWrite(LED_BUILTIN, LOW);
pinMode(PIN0, INPUT_PULLUP); pinMode(PIN0, INPUT_PULLUP);
pinMode(PIN1, INPUT_PULLUP); pinMode(PIN1, INPUT_PULLUP);

View File

@@ -1,6 +1,6 @@
/* /*
* Created: 11/12/2016 19.35.51 * Created: 11/12/2016 19.35.51
* Author : Vincenzo * Author : sancho / Vincenzo
*/ */
#define baudrate 115200 //check if it is the same in processing #define baudrate 115200 //check if it is the same in processing
@@ -24,21 +24,22 @@ uint16_t event = 0;
uint8_t cambio=0; uint8_t cambio=0;
void init_board() { void init_board() {
// PORTC = (0 << 0); DDRC |= (1 << 0); // led A0
DDRB = 0x00; DDRB = 0x00;
DDRC = 0x00; DDRC = 0x00;
DDRL = 0x00; DDRL = 0x00;
if (PULLUP){ if (PULLUP){ // Activamos el pull-up para que de no conectarse nada a puerto lea un uno siempre
PORTA = B11111111; // pull-up for (uint8_t p = 22; p <= 49; p++){
PORTC = B11111111; // Activamos el pull-up para que de no conectarse nada a puerto lea un uno siempre pinMode(p, INPUT_PULLUP);
PORTL = B11111111; }
} }
else{ else{
PORTA = B00000000; for (uint8_t p = 22; p <= 49; p++){
PORTC = B00000000; pinMode(p, INPUT);
PORTL = B00000000;
} }
} }
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
}
void init_timer() { void init_timer() {
@@ -86,7 +87,7 @@ void start() {
reset_timer1(); reset_timer1();
event = 0; event = 0;
//PORTC = (1 << 0); digitalWrite(LED_BUILTIN, HIGH);
initial1 = PINA; initial1 = PINA;
initial2 = PINL; initial2 = PINL;
initial3 = PINC; initial3 = PINC;
@@ -100,12 +101,11 @@ void start() {
//Serial.print(pinChanged1[i]); Serial.print(','); Serial.print(pinChanged2[i]); Serial.print(','); Serial.println(pinChanged3[i]); //Serial.print(pinChanged1[i]); Serial.print(','); Serial.print(pinChanged2[i]); Serial.print(','); Serial.println(pinChanged3[i]);
} }
} }
void sendData() { void sendData() {
//PORTC = (0 << 0); //turn off led digitalWrite(LED_BUILTIN, LOW);
//initial data //initial data
Serial.println("S"); Serial.println("S");
Serial.print(initial1); Serial.print(','); Serial.print(initial2); Serial.print(','); Serial.print(initial3); Serial.print(":"); Serial.print(initial1); Serial.print(','); Serial.print(initial2); Serial.print(','); Serial.print(initial3); Serial.print(":");

View File

@@ -3,15 +3,11 @@
* *
* Author : Vincenzo * Author : Vincenzo
* this works using the unofficial STM32 core, more info: https://github.com/rogerclarkmelbourne/Arduino_STM32 * this works using the unofficial STM32 core, more info: https://github.com/rogerclarkmelbourne/Arduino_STM32
* Led: PB1
*/ */
#define baudrate 115200 // check if it is the same in processing #define baudrate 115200 // check if it is the same in processing
#define samples 200 // the number of samples you want to take #define samples 200 // the number of samples you want to take
#define boardLed PA1
uint16_t initial, state, old_state; uint16_t initial, state, old_state;
uint16_t pinChanged[samples]; uint16_t pinChanged[samples];
@@ -26,8 +22,8 @@ void setup() {
Serial.begin(baudrate); Serial.begin(baudrate);
pinMode (boardLed, OUTPUT); pinMode (LED_BUILTIN, OUTPUT);
digitalWrite(boardLed, LOW); digitalWrite(LED_BUILTIN, LOW);
pinMode(PB0, INPUT_PULLUP); pinMode(PB0, INPUT_PULLUP);
pinMode(PB1, INPUT_PULLUP); pinMode(PB1, INPUT_PULLUP);
pinMode(PB2, INPUT_PULLUP); pinMode(PB2, INPUT_PULLUP);
@@ -54,7 +50,7 @@ void startLA() {
//delay(1000); //delay(1000);
event = 0; event = 0;
digitalWrite(boardLed, HIGH); digitalWrite(LED_BUILTIN, HIGH);
reset_timer(); reset_timer();
initial = GPIOB->regs->IDR; initial = GPIOB->regs->IDR;
@@ -86,7 +82,7 @@ void loop() {
} }
void sendData() { void sendData() {
digitalWrite(boardLed, LOW); digitalWrite(LED_BUILTIN, LOW);
//initial data //initial data
initial1=initial; initial1=initial;