Difference between revisions of "ObjectBlocks: Slider & Blink"

From OnnoWiki
Jump to navigation Jump to search
Line 1: Line 1:
 
[[File:Objectblocks-slider-blink.png|center|600px|thumb]]
 
[[File:Objectblocks-slider-blink.png|center|600px|thumb]]
 +
 +
 +
 +
#include "Channel.h"
 +
#include <Wire.h>
 +
#include "TM1650.h"
 +
TM1650 display;
 +
 +
void setup() {
 +
  // Pin Mode Definition
 +
  pinMode(13, OUTPUT);
 +
  Channel.connect("mFPdJAqtBzpu7t");
 +
  Wire.begin();
 +
  display.init();
 +
}
 +
void loop() {
 +
  Channel.sendNumber("SLIDER", analogRead(A0));
 +
  display.displayNumber((analogRead(A0)));
 +
  Channel.sendNumber("SLIDER", analogRead(A0));
 +
  delay(1000);
 +
  digitalWrite(13, HIGH);
 +
  delay(1000);
 +
  digitalWrite(13, LOW);
 +
}

Revision as of 19:42, 19 March 2023

Objectblocks-slider-blink.png


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

void setup() {
  // Pin Mode Definition
  pinMode(13, OUTPUT);
  Channel.connect("mFPdJAqtBzpu7t");
  Wire.begin();
  display.init();
}
void loop() {
  Channel.sendNumber("SLIDER", analogRead(A0));
  display.displayNumber((analogRead(A0)));
  Channel.sendNumber("SLIDER", analogRead(A0));
  delay(1000);
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
}