Difference between revisions of "ObjectBlocks: Slider & meredup LED"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "center|500px|thumb #include <Wire.h> #include "TM1650.h" #include "Channel.h" TM1650 display; void setup() { // Pin Mode D...")
 
 
Line 3: Line 3:
  
  
#include <Wire.h>
+
#include <Wire.h>
#include "TM1650.h"
+
#include "TM1650.h"
#include "Channel.h"
+
#include "Channel.h"
 
+
TM1650 display;
TM1650 display;
+
 
+
void setup() {
 
+
  // Pin Mode Definition
void setup() {
+
  pinMode(9, OUTPUT);
  // Pin Mode Definition
+
  Channel.connect("mFPdJAqtBzpu7t");
  pinMode(9, OUTPUT);
+
  Wire.begin();
  Channel.connect("mFPdJAqtBzpu7t");
+
  display.init();
  Wire.begin();
+
}
  display.init();
+
 
+
void loop() {
}
+
  display.displayNumber((analogRead(A0)));
 
+
  Channel.sendNumber("SLIDER", analogRead(A0));
void loop() {
+
  delay(1000);
  display.displayNumber((analogRead(A0)));
+
  analogWrite(9, round(analogRead(A0) / 4));
  Channel.sendNumber("SLIDER", analogRead(A0));
+
}
  delay(1000);
 
  analogWrite(9, round(analogRead(A0) / 4));
 
}
 

Latest revision as of 19:55, 19 March 2023

Objectblocks-slider-led-meredup.png


#include <Wire.h>
#include "TM1650.h"
#include "Channel.h"
TM1650 display;

void setup() {
  // Pin Mode Definition
  pinMode(9, OUTPUT);
  Channel.connect("mFPdJAqtBzpu7t");
  Wire.begin();
  display.init();
}

void loop() {
  display.displayNumber((analogRead(A0)));
  Channel.sendNumber("SLIDER", analogRead(A0));
  delay(1000);
  analogWrite(9, round(analogRead(A0) / 4));
}