0 голосов
от (120 баллов)
редактировать от

/**
 * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
 */

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here.
	// For complete reference see:
	// https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html

	// The toolbar groups arrangement, optimized for a single toolbar row.
	config.toolbarGroups = [
		{ name: 'document',	   groups: [ 'mode', 'document', 'doctools' ] },
		{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
		{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
		{ name: 'forms' },
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
		{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
		{ name: 'links' },
		{ name: 'insert' },
		{ name: 'styles' },
		{ name: 'colors' },
		{ name: 'tools' },
		{ name: 'others' },
		{ name: 'about' }
	];

	// The default plugins included in the basic setup define some buttons that
	// are not needed in a basic editor. They are removed here.
	config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';

	// Dialog windows are also simplified.
	config.removeDialogTabs = 'link:advanced';
};
// Include two libraries required to work with the module
// <https://github.com/amperka/Octoliner>
#include <Wire.h>
#include <Octoliner.h>

// Sensor on the standard bus and address
Octoliner octoliner;

void setup() {
  Serial.begin(115200);
  octoliner.begin();

  // Setup lightness parameters
  octoliner.setSensitivity(200);
  octoliner.setBrightness(255);
}

void loop() {
  // Every 0.5 seconds...
  delay(500);

  // ...scan all 8 channels and output
  // the values to Serial Monitor
  for (int i = 0; i < 8; i++) {
    Serial.print(octoliner.analogRead(i));
    Serial.print("\t"); // separate with TABs
  }

  Serial.println(); // line feed at the end
}

import time

# Import the class required from the `octoliner` library
# <https://github.com/amperka/OctolinerPi>
from octoliner import Octoliner

# Sensor on the standard bus and address
octoliner = Octoliner()

# Setup lightness parameters
octoliner.set_sensitivity(0.8)
octoliner.set_brightness(1.0)

while True:
    # Read all channel values
    values = [octoliner.analog_read(i) for i in range(8)]

    # Print them to console
    print(values)

    # Repeat forever, twice per second
    time.sleep(0.5)

Пожалуйста, войдите или зарегистрируйтесь чтобы ответить на этот вопрос.

Популярные теги

Добро пожаловать на сайт Бредборд, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...