Relazione TECHNO KART
Relazione TECHNO KART
Techno cart is a smart choice if you want to improve your awareness of your food shopping
and your diet. Using Techno cart you can check all the most important information about the
food that you are going to buy.
Techno cart is the solution if you want to eat better.
The GM65 is a bar code reader, it’s connected to the programmable board Arduino UNO and
with the HC06 transmit the data from Arduino UNO to the monitor.
We can control our electric motor using a button and a trimmer. With the button we can
control the ON/OFF status of the motor and with the trimmer we can manage the speed.
Schema elettrico:
Sketch:
#include<SoftwareSerial.h>
SoftwareSerial ss(1,0);
void setup()
{
Serial.begin(9600);
ss.begin(9660);
delay(1000);
Serial.println("pronto");
}
void loop()
{
if(ss.available())
{Serial.write(ss.read());
}
}
Sketch:
#define MOTOR_PIN 3
#define BUTTON_PIN 4
#define POTENTIOMETER_PIN A0
#define BOOT_TIME 400
bool enabled = false;
int lastEnableValue = LOW;
unsigned long startTime = 0;
void setup(){
pinMode(MOTOR_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);
}
void loop(){
int enableValue = digitalRead(BUTTON_PIN);
if(enableValue != lastEnableValue && enableValue == HIGH){
if(!enabled){
startTime = millis();
}
enabled = !enabled;
}
lastEnableValue = enableValue;
if(enabled){
if((millis()-startTime) > BOOT_TIME){
int motorSpeed = map(analogRead(POTENTIOMETER_PIN), 0, 1023, 70, 255);
analogWrite(MOTOR_PIN, motorSpeed);
}else{
analogWrite(MOTOR_PIN, 255);
}
}else{
analogWrite(MOTOR_PIN, 0);
}
delay(50);
}