mirror of
https://github.com/aster94/logic-analyzer.git
synced 2026-05-01 15:10:43 +03:00
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:
1312
Computer_Interface/Computer_Interface.pde
Normal file
1312
Computer_Interface/Computer_Interface.pde
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,23 +5,23 @@
|
||||
* Test your logic analyzer with another arduino
|
||||
*/
|
||||
|
||||
#define led A5
|
||||
#define led2 13
|
||||
#define pin1 A5
|
||||
#define pin2 13
|
||||
|
||||
void setup() {
|
||||
pinMode(led, OUTPUT);
|
||||
pinMode(led2, OUTPUT);
|
||||
pinMode(pin1, OUTPUT);
|
||||
pinMode(pin2, OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
digitalWrite(led, HIGH);
|
||||
digitalWrite(pin1, HIGH);
|
||||
delayMicroseconds(random(200));
|
||||
digitalWrite(led2, HIGH);
|
||||
digitalWrite(pin2, HIGH);
|
||||
delayMicroseconds(random(200));
|
||||
digitalWrite(led2, LOW);
|
||||
digitalWrite(pin2, LOW);
|
||||
delayMicroseconds(random(200));
|
||||
digitalWrite(led, LOW);
|
||||
digitalWrite(pin1, LOW);
|
||||
delayMicroseconds(random(200));
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
* ESP8266.ino
|
||||
*
|
||||
* Author : yoursunny
|
||||
* Led: LED_BUILTIN
|
||||
*/
|
||||
|
||||
#include <c_types.h>
|
||||
@@ -31,7 +30,7 @@ void setup() {
|
||||
Serial.begin(baudrate);
|
||||
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
|
||||
pinMode(PIN0, INPUT_PULLUP);
|
||||
pinMode(PIN1, INPUT_PULLUP);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Created: 11/12/2016 19.35.51
|
||||
* Author : Vincenzo
|
||||
* Author : sancho / Vincenzo
|
||||
*/
|
||||
|
||||
#define baudrate 115200 //check if it is the same in processing
|
||||
@@ -24,20 +24,21 @@ uint16_t event = 0;
|
||||
uint8_t cambio=0;
|
||||
void init_board() {
|
||||
|
||||
// PORTC = (0 << 0); DDRC |= (1 << 0); // led A0
|
||||
DDRB = 0x00;
|
||||
DDRC = 0x00;
|
||||
DDRL = 0x00;
|
||||
if (PULLUP){
|
||||
PORTA = B11111111; // pull-up
|
||||
PORTC = B11111111; // Activamos el pull-up para que de no conectarse nada a puerto lea un uno siempre
|
||||
PORTL = B11111111;
|
||||
if (PULLUP){ // Activamos el pull-up para que de no conectarse nada a puerto lea un uno siempre
|
||||
for (uint8_t p = 22; p <= 49; p++){
|
||||
pinMode(p, INPUT_PULLUP);
|
||||
}
|
||||
}
|
||||
else{
|
||||
PORTA = B00000000;
|
||||
PORTC = B00000000;
|
||||
PORTL = B00000000;
|
||||
}
|
||||
for (uint8_t p = 22; p <= 49; p++){
|
||||
pinMode(p, INPUT);
|
||||
}
|
||||
}
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
}
|
||||
|
||||
void init_timer() {
|
||||
@@ -86,7 +87,7 @@ void start() {
|
||||
reset_timer1();
|
||||
event = 0;
|
||||
|
||||
//PORTC = (1 << 0);
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
initial1 = PINA;
|
||||
initial2 = PINL;
|
||||
initial3 = PINC;
|
||||
@@ -100,12 +101,11 @@ void start() {
|
||||
//Serial.print(pinChanged1[i]); Serial.print(','); Serial.print(pinChanged2[i]); Serial.print(','); Serial.println(pinChanged3[i]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void sendData() {
|
||||
//PORTC = (0 << 0); //turn off led
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
//initial data
|
||||
Serial.println("S");
|
||||
Serial.print(initial1); Serial.print(','); Serial.print(initial2); Serial.print(','); Serial.print(initial3); Serial.print(":");
|
||||
|
||||
@@ -3,15 +3,11 @@
|
||||
*
|
||||
* Author : Vincenzo
|
||||
* 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 samples 200 // the number of samples you want to take
|
||||
#define boardLed PA1
|
||||
|
||||
|
||||
|
||||
uint16_t initial, state, old_state;
|
||||
uint16_t pinChanged[samples];
|
||||
@@ -26,8 +22,8 @@ void setup() {
|
||||
|
||||
Serial.begin(baudrate);
|
||||
|
||||
pinMode (boardLed, OUTPUT);
|
||||
digitalWrite(boardLed, LOW);
|
||||
pinMode (LED_BUILTIN, OUTPUT);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
pinMode(PB0, INPUT_PULLUP);
|
||||
pinMode(PB1, INPUT_PULLUP);
|
||||
pinMode(PB2, INPUT_PULLUP);
|
||||
@@ -54,7 +50,7 @@ void startLA() {
|
||||
//delay(1000);
|
||||
|
||||
event = 0;
|
||||
digitalWrite(boardLed, HIGH);
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
|
||||
reset_timer();
|
||||
initial = GPIOB->regs->IDR;
|
||||
@@ -86,7 +82,7 @@ void loop() {
|
||||
}
|
||||
|
||||
void sendData() {
|
||||
digitalWrite(boardLed, LOW);
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
|
||||
//initial data
|
||||
initial1=initial;
|
||||
|
||||
Reference in New Issue
Block a user