My own TCL firmware
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Gerardo Marx bb537c1fcc serial comunication and basic commands 2 days ago
my-tclab-firmware serial comunication and basic commands 2 days ago
Readme.md adding readme 3 days ago
main.ipynb serial comunication and basic commands 2 days ago

Readme.md

Introduction

Basic

Digital outputs

#include <Arduino.h>
// vars and pins
const int led = 9;

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(led, LOW);
  delay(500);
  digitalWrite(led, HIGH);
  delay(500);
}

PWM outputs

#include <Arduino.h>
// vars and pins
const int led = 9;

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.print("pwm on\n");
  for(int pwm=0; pwm<=255; pwm+=5){
    analogWrite(led, pwm);
    delay(50);
  }
Serial.print("pwm off\n");
for(int pwm=255; pwm>=0; pwm-=5){
    analogWrite(led, pwm);
    delay(50);
  }
}

Analog readings

#include <Arduino.h>
// vars and pins
const int led = 9;
const int T2 = A2;
int T2Val;

void setup() {
  // put your setup code here, to run once:
  //pinMode(led, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  T2Val = analogRead(T2);
  Serial.print("ADC: ");
  Serial.println(T2Val);
  delay(100);
}